Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SessionOptions

Options used to create session.

Hierarchy

  • SessionOptions

Index

Constructors

constructor

  • Returns SessionOptions

  • Parameters

    Returns SessionOptions

Methods

getBehavior

  • Set the behavior when a session is invalidated. The release behavior is the default if none is specified.

    Returns SessionBehavior

getChecks

  • getChecks(): string[]
  • Set a list of associated health checks. It is highly recommended that, if you override this list, you include the default "serfHealth"

    Returns string[]

getLockDelay

  • getLockDelay(): number
  • Set the lock-delay period.

    Returns number

getName

  • getName(): string
  • Set the human-readable name for the Session

    Returns string

getNode

  • getNode(): string
  • Set the node to which the session will be assigned

    Returns string

getTtl

  • getTtl(): number
  • Set the TTL interval. When TTL interval expires without being renewed, the session has expired and an invalidation is triggered. If specified, it must be between 10s and 86400s currently.

    The contract of a TTL is that it represents a lower bound for invalidation; that is, Consul will not expire the session before the TTL is reached, but it is allowed to delay the expiration past the TTL.

    The lowest practical TTL should be used to keep the number of managed sessions low. When locks are forcibly expired, such as during a leader election, sessions may not be reaped for up to double this TTL, so long TTL values (> 1 hour) should be avoided.

    Returns number

setBehavior

  • Set the behavior when a session is invalidated. The release behavior is the default if none is specified.

    Parameters

    Returns SessionOptions

setChecks

  • Set a list of associated health checks. It is highly recommended that, if you override this list, you include the default "serfHealth"

    Parameters

    • checks: string[]

    Returns SessionOptions

setLockDelay

  • Set the lock-delay period.

    Parameters

    • lockDelay: number

    Returns SessionOptions

setName

  • Set the human-readable name for the Session

    Parameters

    • name: string

    Returns SessionOptions

setNode

  • Set the node to which the session will be assigned

    Parameters

    • node: string

    Returns SessionOptions

setTtl

  • Set the TTL interval. When TTL interval expires without being renewed, the session has expired and an invalidation is triggered. If specified, it must be between 10s and 86400s currently.

    The contract of a TTL is that it represents a lower bound for invalidation; that is, Consul will not expire the session before the TTL is reached, but it is allowed to delay the expiration past the TTL.

    The lowest practical TTL should be used to keep the number of managed sessions low. When locks are forcibly expired, such as during a leader election, sessions may not be reaped for up to double this TTL, so long TTL values (> 1 hour) should be avoided.

    Parameters

    • ttl: number

    Returns SessionOptions

toJson

  • toJson(): {}
  • Returns {}

    • [key: string]: any

Generated using TypeDoc