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

    Interface QueueOptions

    Queue options

    interface QueueOptions {
        autoBatch?: AutoBatchOptions;
        connection?: ConnectionOptions;
        dataPath?: string;
        defaultJobOptions?: JobOptions;
        embedded?: boolean;
        prefixKey?: string;
    }
    Index
    autoBatch?: AutoBatchOptions

    Auto-batching for queue.add() calls in TCP mode. Buffers individual add() calls and sends them as a single PUSHB command. Gives 10-100x throughput improvement for sequential add() calls over TCP. Default: enabled for TCP mode, disabled for embedded mode.

    connection?: ConnectionOptions

    Connection options - if omitted, connects to localhost:6789

    dataPath?: string

    SQLite database path for embedded mode (overrides DATA_PATH env var)

    defaultJobOptions?: JobOptions
    embedded?: boolean

    Use embedded mode (in-process SQLite) instead of TCP

    prefixKey?: string

    Namespace prefix prepended to the queue name on the server. Lets multiple environments (e.g. dev:, prod:) share the same broker without their jobs, workers, cron schedulers, stats, or DLQ overlapping.

    The user-facing queue.name stays the logical name; only the server-side key and the cron scheduler IDs are prefixed. A Worker that wants to consume from the namespaced queue must use the same prefixKey.