HeartbeatOptions
Defined in: packages/ws/src/heartbeat.ts:28
Collaborators the heartbeat needs from its owner.
Properties
Section titled “Properties”ackTimeout
Section titled “ackTimeout”ackTimeout:
number
Defined in: packages/ws/src/heartbeat.ts:30
Milliseconds to wait for an ACK before declaring the connection dead.
isConnected
Section titled “isConnected”isConnected: () =>
boolean
Defined in: packages/ws/src/heartbeat.ts:41
Whether the underlying connection is open.
Returns
Section titled “Returns”boolean
optionalnow?: () =>number
Defined in: packages/ws/src/heartbeat.ts:47
Clock injection point for tests.
Returns
Section titled “Returns”number
onError
Section titled “onError”onError: (
error) =>void
Defined in: packages/ws/src/heartbeat.ts:45
Called for non-fatal problems, such as a heartbeat that could not be sent.
Parameters
Section titled “Parameters”Error
Returns
Section titled “Returns”void
onTimeout
Section titled “onTimeout”onTimeout: (
timeout) =>void
Defined in: packages/ws/src/heartbeat.ts:43
Called when the connection fails a liveness check.
Parameters
Section titled “Parameters”timeout
Section titled “timeout”Returns
Section titled “Returns”void
send: (
sequence) =>boolean
Defined in: packages/ws/src/heartbeat.ts:37
Writes a heartbeat payload.
Parameters
Section titled “Parameters”sequence
Section titled “sequence”number | null
Returns
Section titled “Returns”boolean
Whether it reached the wire; false is reported as an error.
sequence
Section titled “sequence”sequence: () =>
number|null
Defined in: packages/ws/src/heartbeat.ts:39
Current session sequence, sent as the heartbeat’s d.
Returns
Section titled “Returns”number | null
zombieTimeout
Section titled “zombieTimeout”zombieTimeout:
number
Defined in: packages/ws/src/heartbeat.ts:32
Minimum silence before the connection is treated as a zombie.