Member Junction
    Preparing search index...

    Interface RealtimeSessionResumptionOptions

    Callbacks and tuning for RealtimeSessionResumption.

    interface RealtimeSessionResumptionOptions {
        AttemptTimeoutMs?: number;
        DeadlineMarginMs?: number;
        Log?: (message: string) => void;
        OnReconnected?: () => void;
        OnReconnectFailed: (error: Error) => void;
        OnReconnecting?: (reason: RealtimeReconnectReason) => void;
        Reconnect: (
            handle: string,
            attempt: RealtimeResumeAttempt,
        ) => Promise<void>;
        RetryDelaysMs?: readonly number[];
    }
    Index

    Properties

    AttemptTimeoutMs?: number

    How long one attempt may take before it counts as failed. A socket that never opens would otherwise leave the session reconnecting forever. Defaults to REALTIME_RESUMPTION_ATTEMPT_TIMEOUT_MS.

    DeadlineMarginMs?: number

    The longest margin the helper keeps before an announced connection end. When no resumable point has arrived by then, it reconnects with the last handle. The margin is a third of the notice, so a turn in progress gets the rest of it to finish, kept between REALTIME_RESUMPTION_MIN_DEADLINE_MARGIN_MS (what a reconnect needs) and this value. Defaults to REALTIME_RESUMPTION_DEADLINE_MARGIN_MS.

    Log?: (message: string) => void

    Diagnostic sink; defaults to no logging.

    OnReconnected?: () => void

    The replacement connection is in use.

    OnReconnectFailed: (error: Error) => void

    Every attempt failed. The driver surfaces its usual fatal error here; the helper never reconnects again after this.

    OnReconnecting?: (reason: RealtimeReconnectReason) => void

    A reconnect started. Drivers report this as 'connecting' so hosts can show "reconnecting".

    Reconnect: (handle: string, attempt: RealtimeResumeAttempt) => Promise<void>

    Opens a replacement connection that resumes the session from handle, and makes it the driver's current connection. Resolves once the new connection is in use; rejects on failure.

    RetryDelaysMs?: readonly number[]

    Delay before each attempt, in milliseconds; the array length is the attempt count. Defaults to REALTIME_RESUMPTION_RETRY_DELAYS_MS.