Skip to content

StreamOptions

StreamOptions<T, V> = object

Defined in: sdks/js/node-sdk/dist/index.d.ts:302

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/dist/index.d.ts:349

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/dist/index.d.ts:306

Called when the stream ends

void


optional onError?: (error) => void

Defined in: sdks/js/node-sdk/dist/index.d.ts:310

Called when a stream error occurs

Error

void


optional onFail?: () => void

Defined in: sdks/js/node-sdk/dist/index.d.ts:314

Called when a notification stream fails

void


optional onRestart?: () => void

Defined in: sdks/js/node-sdk/dist/index.d.ts:318

Called when a notification stream is restarted

void


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

Defined in: sdks/js/node-sdk/dist/index.d.ts:322

Called when a notification stream is retried

number

number

void


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

Defined in: sdks/js/node-sdk/dist/index.d.ts:328

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/dist/index.d.ts:333

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


optional retryDelay?: number

Defined in: sdks/js/node-sdk/dist/index.d.ts:338

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


optional retryOnFail?: boolean

Defined in: sdks/js/node-sdk/dist/index.d.ts:343

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