bunqueue v2.8 API referenceall versions · guide
bunqueue
    Preparing search index...

    Interface PendingCommand

    Pending command awaiting response

    interface PendingCommand {
        command: Record<string, unknown>;
        id: number;
        promise?: Promise<Record<string, unknown>>;
        reject: (error: Error) => void;
        reqId: string;
        resolve: (value: Record<string, unknown>) => void;
        timeout: Timeout;
    }
    Index
    command: Record<string, unknown>
    id: number
    promise?: Promise<Record<string, unknown>>

    Reference to the Promise returned to the caller. Used by rejectAll() on intentional shutdown to attach a silent .catch — prevents unhandled rejections from leaking when callers (fire-and-forget heartbeats, polling loops mid-await) don't have a .catch in place at the moment we reject.

    reject: (error: Error) => void
    reqId: string

    Request ID for response matching (pipelining support)

    resolve: (value: Record<string, unknown>) => void
    timeout: Timeout