Skip to content

StreamOptions

StreamOptions<T, V> = object

Defined in: sdks/js/node-sdk/src/utils/streams.ts:14

Notification streams created by createStream use the retry settings and hooks. Durable message streams use onValue, onError, and onEnd. Core handles their network recovery; notification retry settings and hooks do not apply.

T = unknown

V = T

optional disableSync?: boolean

Defined in: sdks/js/node-sdk/src/utils/streams.ts:61

Whether to skip pre-sync for notification streams. Durable message readers start receipt without a separate pre-sync. (default: false)


optional onEnd?: () => void

Defined in: sdks/js/node-sdk/src/utils/streams.ts:18

Called when the stream ends

void


optional onError?: (error) => void

Defined in: sdks/js/node-sdk/src/utils/streams.ts:22

Called when a stream error occurs

Error

void


optional onFail?: () => void

Defined in: sdks/js/node-sdk/src/utils/streams.ts:26

Called when a notification stream fails

void


optional onRestart?: () => void

Defined in: sdks/js/node-sdk/src/utils/streams.ts:30

Called when a notification stream is restarted

void


optional onRetry?: (attempts, maxAttempts) => void

Defined in: sdks/js/node-sdk/src/utils/streams.ts:34

Called when a notification stream is retried

number

number

void


optional onValue?: (value) => void | Promise<void>

Defined in: sdks/js/node-sdk/src/utils/streams.ts:40

Called when a value is emitted from the stream. For message streams, this selects callback mode. Do not also iterate that stream. Message delivery is acknowledged after this callback returns successfully.

V

void | Promise<void>


optional retryAttempts?: number

Defined in: sdks/js/node-sdk/src/utils/streams.ts:45

The number of times to retry a notification stream (default: 10)


optional retryDelay?: number

Defined in: sdks/js/node-sdk/src/utils/streams.ts:50

The delay between notification stream retries (in milliseconds) (default: 60000)


optional retryOnFail?: boolean

Defined in: sdks/js/node-sdk/src/utils/streams.ts:55

Whether to retry a notification stream if it fails (default: true)