@camunda8/sdk
    Preparing search index...

    Interface StreamJobsRecoveryOptions

    Options controlling how streamJobs reports and recovers from a job stream that dies (stream error, server-side end/close, or a failed open).

    interface StreamJobsRecoveryOptions {
        onStreamEnd?: () => void | Promise<void>;
        onStreamError?: (error: Error) => void | Promise<void>;
        onStreamReconnect?: (attempt: number) => void | Promise<void>;
        streamReconnect?:
            | boolean
            | { initialDelayMs?: number; maxDelayMs?: number };
    }
    Index

    Properties

    onStreamEnd?: () => void | Promise<void>

    Called when the server ends or closes the job stream without an error. Exceptions thrown by the callback, and rejections of a returned promise, are caught and logged.

    onStreamError?: (error: Error) => void | Promise<void>

    Called when the job stream fails: a stream error event, or a failed attempt to open the stream. Exceptions thrown by the callback, and rejections of a returned promise, are caught and logged.

    onStreamReconnect?: (attempt: number) => void | Promise<void>

    Called just before each attempt to re-open a dead stream. attempt is the number of consecutive failed streams or open attempts, starting at 1. It resets once a re-opened stream delivers a job or stays up for at least maxDelayMs. Exceptions thrown by the callback, and rejections of a returned promise, are caught and logged.

    streamReconnect?: boolean | { initialDelayMs?: number; maxDelayMs?: number }

    Re-open the stream when it dies. Defaults to true, with exponential backoff starting at 1000ms and capped at 30000ms. Pass false to disable reconnection (the onStream* callbacks still fire), or an object to tune the backoff. After a re-opened stream is established, one backfill poll runs to pick up jobs that were created while the stream was down.