Skip to content

ChangeStreamClientOptions

Defined in: libs/runtime/src/change-stream-client.ts:55

How a ChangeStreamClient connects and retries.

Properties

Name Description
headers? Headers to send with every request — a bearer token, for a hub that wants one.
maxRetries? How many failed connection attempts in a row to retry before giving up, calling onFailed with 'transport'.
retryMs? Retry delay after a dropped connection, in milliseconds.

readonly optional headers?: () => Record<string, string> | Promise<Record<string, string>>

Defined in: libs/runtime/src/change-stream-client.ts:68

Headers to send with every request — a bearer token, for a hub that wants one. A function, and called per request, because a token expires and a long-lived subscription must not keep presenting the one it started with.

Record<string, string> | Promise<Record<string, string>>


readonly optional maxRetries?: number

Defined in: libs/runtime/src/change-stream-client.ts:62

How many failed connection attempts in a row to retry before giving up, calling onFailed with 'transport'. A connection that succeeds resets the count. Default 5.


readonly optional retryMs?: number

Defined in: libs/runtime/src/change-stream-client.ts:57

Retry delay after a dropped connection, in milliseconds. It grows linearly with each failed attempt. Default 200.

TypeDBLite is an independent open-source project, built on TypeDB with thanks. It is not affiliated with, sponsored by, or endorsed by TypeDB Ltd. Released under the MPL-2.0 license.