Skip to content

HeartbeatOptions

Defined in: packages/ws/src/heartbeat.ts:28

Collaborators the heartbeat needs from its owner.

ackTimeout: number

Defined in: packages/ws/src/heartbeat.ts:30

Milliseconds to wait for an ACK before declaring the connection dead.


isConnected: () => boolean

Defined in: packages/ws/src/heartbeat.ts:41

Whether the underlying connection is open.

boolean


optional now?: () => number

Defined in: packages/ws/src/heartbeat.ts:47

Clock injection point for tests.

number


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.

Error

void


onTimeout: (timeout) => void

Defined in: packages/ws/src/heartbeat.ts:43

Called when the connection fails a liveness check.

HeartbeatTimeout

void


send: (sequence) => boolean

Defined in: packages/ws/src/heartbeat.ts:37

Writes a heartbeat payload.

number | null

boolean

Whether it reached the wire; false is reported as an error.


sequence: () => number | null

Defined in: packages/ws/src/heartbeat.ts:39

Current session sequence, sent as the heartbeat’s d.

number | null


zombieTimeout: number

Defined in: packages/ws/src/heartbeat.ts:32

Minimum silence before the connection is treated as a zombie.