bullmq - v6.0.3
    Preparing search index...

    Interface IQueueBackend

    IQueueBackend

    Database-agnostic contract describing every high-level operation that the Queue, Worker and Job classes need in order to function. The goal of this interface is to express the queue semantics ("move job to active", "extend lock", "promote job", …) independently of the underlying datastore.

    Built-in implementations currently include the Redis adapter (RedisQueueBackend) and the PostgreSQL adapter. Both fulfil the same operations over different datastores without requiring any change to Queue, Worker or Job.

    The method names and signatures intentionally mirror the existing RedisQueueBackend class so that the Redis adapter is a near drop-in implementation. Operations that used to be performed via direct datastore commands scattered across the three classes (queue metadata, job getters, the blocking "wait for next job" primitive, …) have been promoted into this interface so that the three classes never need to talk to the datastore directly.

    Low-level, Redis-specific helpers (Lua KEYS/ARGV builders, error-code mapping, runCommand, …) are deliberately not part of this contract. They remain private implementation details of the Redis adapter.

    The interface intentionally exposes no connection or transaction type: a concrete adapter owns its connection(s). For example, the Redis adapter is built from a context that provides an IRedisClient (plus a dedicated blocking client for IQueueBackend.waitForJob), so callers never thread a connection or transaction through an operation.

    interface IQueueBackend {
        closing: Promise<void>;
        keys: KeysMap;
        minimumBlockTimeout: number;
        qualifiedName: string;
        addFlow(
            entries: {
                jobData: JobJson;
                jobId: string;
                parentKeyOpts: ParentKeyOpts;
                prefix: string;
                queueName: string;
            }[],
        ): Promise<[Error, string | number][]>;
        addJob(
            job: JobJson,
            jobId: string,
            parentKeyOpts?: ParentKeyOpts,
        ): Promise<string>;
        addJobs(
            entries: { job: JobJson; jobId: string; parentKeyOpts?: ParentKeyOpts }[],
        ): Promise<string[]>;
        addJobScheduler(
            jobSchedulerId: string,
            nextMillis: number,
            templateData: string,
            templateOpts: JobsOptions,
            opts: RepeatableOptions,
            delayedJobOpts: JobsOptions,
            producerId?: string,
        ): Promise<[string, number]>;
        addLog(jobId: string, logRow: string, keepLogs?: number): Promise<number>;
        changeDelay(jobId: string, delay: number): Promise<void>;
        changePriority(
            jobId: string,
            priority?: number,
            lifo?: boolean,
        ): Promise<void>;
        cleanJobsByState(
            state: string,
            timestamp: number,
            limit?: number,
        ): Promise<string[]>;
        clearLogs(jobId: string, keepLogs?: number): Promise<void>;
        clientName(suffix?: string): string;
        close(force?: boolean): Promise<void>;
        deleteDeduplicationKey(deduplicationId: string): Promise<number>;
        disconnect(): Promise<void>;
        disconnectBlocking(wait?: boolean): Promise<void>;
        drain(delayed: boolean): Promise<void>;
        extendLock(jobId: string, token: string, duration: number): Promise<number>;
        extendLocks(
            jobIds: string[],
            tokens: string[],
            duration: number,
        ): Promise<string[]>;
        forQueue(queueName: string, prefix?: string): IQueueBackend;
        getClientList(): Promise<string[]>;
        getCounts(types: JobType[]): Promise<number[]>;
        getCountsPerPriority(priorities: number[]): Promise<number[]>;
        getDeduplicationJobId(deduplicationId: string): Promise<string>;
        getDependencies(
            jobId: string,
            opts: DependenciesOpts,
        ): Promise<
            {
                failed?: string[];
                ignored?: Record<string, any>;
                nextFailedCursor?: number;
                nextIgnoredCursor?: number;
                nextProcessedCursor?: number;
                nextUnprocessedCursor?: number;
                processed?: Record<string, any>;
                unprocessed?: string[];
            },
        >;
        getDependencyCounts(jobId: string, types: string[]): Promise<number[]>;
        getIgnoredChildrenFailures(jobId: string): Promise<Record<string, string>>;
        getJobData(jobId: string): Promise<JobJson>;
        getJobLogs(
            jobId: string,
            start: number,
            end: number,
            asc: boolean,
        ): Promise<{ count: number; logs: string[] }>;
        getJobScheduler(id: string): Promise<[any, string]>;
        getJobSchedulerData(key: string): Promise<Record<string, string>>;
        getJobSchedulersCount(): Promise<number>;
        getJobSchedulersRange(
            start: number,
            end: number,
            asc: boolean,
        ): Promise<string[]>;
        getMetrics(
            type: "failed" | "completed",
            start?: number,
            end?: number,
        ): Promise<[string[], string[], number]>;
        getProcessedChildrenValues(jobId: string): Promise<Record<string, string>>;
        getQueueMeta(): Promise<Record<string, string>>;
        getQueueMetaField(field: string): Promise<string>;
        getQueueMetaFields(fields: string[]): Promise<string[]>;
        getRanges(
            types: JobType[],
            start?: number,
            end?: number,
            asc?: boolean,
        ): Promise<[string][]>;
        getRateLimitTtl(maxJobs?: number): Promise<number>;
        getState(jobId: string): Promise<"unknown" | JobState>;
        hasQueueMetaField(field: string): Promise<boolean>;
        isFinished(
            jobId: string,
            returnValue?: boolean,
        ): Promise<number | [number, string]>;
        isJobInState(state: string, jobId: string): Promise<boolean>;
        isJobScheduler(id: string): Promise<boolean>;
        isMaxed(): Promise<boolean>;
        moveJobFromActiveToWait(jobId: string, token?: string): Promise<number>;
        moveStalledJobsToWait(): Promise<string[]>;
        moveToActive(token: string, name?: string): Promise<any[]>;
        moveToCompleted<T = any, R = any, N extends string = string>(
            job: MinimalJob<T, R, N>,
            returnValue: R,
            removeOnComplete: number | boolean | KeepJobs,
            token: string,
            fetchNext: boolean,
        ): Promise<{ finishedOn: number; result: void | any[] }>;
        moveToDelayed(
            jobId: string,
            timestamp: number,
            delay: number,
            token?: string,
            opts?: MoveToDelayedOpts,
        ): Promise<void | any[]>;
        moveToFailed<T = any, R = any, N extends string = string>(
            job: MinimalJob<T, R, N>,
            failedReason: string,
            removeOnFail: number | boolean | KeepJobs,
            token: string,
            fetchNext: boolean,
            fieldsToUpdate?: Record<string, any>,
        ): Promise<{ finishedOn: number; result: void | any[] }>;
        moveToWaitingChildren(
            jobId: string,
            token: string,
            opts?: MoveToWaitingChildrenOpts,
        ): Promise<boolean>;
        obliterate(opts: { count: number; force: boolean }): Promise<number>;
        on(
            event: "error" | "close" | "ready",
            listener: (...args: any[]) => void,
        ): this;
        once(
            event: "error" | "close" | "ready",
            listener: (...args: any[]) => void,
        ): this;
        paginate(
            key: string,
            opts: { end: number; fetchJobs?: boolean; start: number },
        ): Promise<
            {
                cursor: string;
                items: { err?: string; id: string; v?: any }[];
                jobs?: JobJson[];
                total: number;
            },
        >;
        parseNodeKey(
            key: string,
        ): { id: string; prefix: string; queueName: string };
        pause(pause: boolean): Promise<void>;
        promote(jobId: string): Promise<void>;
        promoteJobs(count?: number): Promise<number>;
        publishEvent(
            fields: Record<string, string | number>,
            maxEvents: number,
        ): Promise<string>;
        readEvents(
            id: string,
            blockTimeout: number,
        ): Promise<[string, EntryRaw[]][]>;
        reconnectBlocking(): Promise<void>;
        remove(jobId: string, removeChildren: boolean): Promise<number>;
        removeChildDependency(jobId: string, parentKey: string): Promise<boolean>;
        removeDeduplicationKey(
            deduplicationId: string,
            jobId: string,
        ): Promise<number>;
        removeDeprecatedPriorityKey(): Promise<number>;
        removeJobScheduler(jobSchedulerId: string): Promise<number>;
        removeListener(event: string, listener: (...args: any[]) => void): this;
        removeOrphanedJobs(count?: number, limit?: number): Promise<number>;
        removeQueueMetaFields(fields: string[]): Promise<number>;
        removeRateLimitKey(): Promise<number>;
        removeUnprocessedChildren(jobId: string): Promise<void>;
        retryFinishedJob<T = any, R = any, N extends string = string>(
            job: MinimalJob<T, R, N>,
            state: "failed" | "completed",
            opts?: RetryOptions,
        ): Promise<void>;
        retryFinishedJobs(
            state?: FinishedStatus,
            count?: number,
            timestamp?: number,
        ): Promise<number>;
        retryJob(
            jobId: string,
            lifo: boolean,
            token?: string,
            opts?: RetryJobOpts,
        ): Promise<void>;
        setName(name: string): Promise<void>;
        setQueueMeta(values: Record<string, string | number>): Promise<number>;
        setRateLimit(expireTimeMs: number): Promise<void>;
        toKey(type: string): string;
        trimEvents(maxLength: number): Promise<number>;
        updateData<T = any, R = any, N extends string = string>(
            job: MinimalJob<T, R, N>,
            data: T,
        ): Promise<void>;
        updateJobSchedulerNextMillis(
            jobSchedulerId: string,
            nextMillis: number,
            templateData: string,
            delayedJobOpts: JobsOptions,
            producerId?: string,
        ): Promise<string>;
        updateProgress(jobId: string, progress: JobProgress): Promise<void>;
        waitForJob(
            blockTimeout: number,
        ): Promise<{ member: string; score: number }>;
        waitUntilReady(): Promise<void>;
    }

    Implemented by

    Index
    closing: Promise<void>

    Truthy once IQueueBackend.close has begun (resolves when the close completes). Used by the worker to decide whether it is still safe to issue datastore operations (e.g. completing the current job) while the higher-level instance is shutting down.

    keys: KeysMap

    The map of named sub-keys/identifiers for the queue. For Redis these are the concrete Redis keys; backends that don't address jobs by key may return an empty map.

    minimumBlockTimeout: number

    Smallest meaningful block timeout (in seconds) supported by the backend's blocking primitive. Used by workers to bound waitForJob.

    qualifiedName: string

    The queue's fully-qualified name (the cross-backend logical identifier used e.g. as a flow parent reference). Redis: "<prefix>:<queue>".

    • Atomically inserts a flow (tree) of jobs that may span multiple queues, returning one [error, idOrCode] tuple per entry, in the same order they were provided. Each entry is self-describing (it carries its own queue prefix/queueName), so the operation is not bound to a single queue.

      For the Redis adapter this is a single MULTI; a SQL backend would use a single transaction.

      Parameters

      • entries: {
            jobData: JobJson;
            jobId: string;
            parentKeyOpts: ParentKeyOpts;
            prefix: string;
            queueName: string;
        }[]

      Returns Promise<[Error, string | number][]>

    • Adds a single job to the queue, routing it to the correct initial state (wait / delayed / prioritized / waiting-children) based on its options.

      The backend uses its own connection — callers never pass one in.

      Parameters

      Returns Promise<string>

    • Adds many jobs to the queue in a single, efficient operation.

      How the insert is batched (a Redis pipeline, a single multi-row SQL INSERT, a transaction, …) is entirely an implementation detail of the backend; the contract only requires that all jobs are added and their ids returned in order.

      Parameters

      Returns Promise<string[]>

      The generated ids, in the same order as entries.

    • Registers a job scheduler and enqueues its next delayed iteration.

      Two job-option bags are involved, with deliberately different roles:

      • templateOpts — the scheduler's template options, stored once and reused as the basis for every future iteration produced by the scheduler.
      • delayedJobOpts — the fully-resolved options for the single delayed job created right now: the template plus this iteration's jobId, delay, repeat.offset/count, etc.

      Parameters

      Returns Promise<[string, number]>

      A tuple of [jobId, delay] for the next iteration.

    • Appends a row to a job's log, optionally trimming old entries.

      Parameters

      • jobId: string
      • logRow: string
      • OptionalkeepLogs: number

      Returns Promise<number>

      The total number of log entries.

    • Changes the delay of a delayed job.

      Parameters

      • jobId: string
      • delay: number

      Returns Promise<void>

    • Changes the priority (and optionally lifo) of a waiting job.

      Parameters

      • jobId: string
      • Optionalpriority: number
      • Optionallifo: boolean

      Returns Promise<void>

    • Removes jobs in a given state that are older than timestamp.

      Parameters

      • state: string
      • timestamp: number
      • Optionallimit: number

      Returns Promise<string[]>

      The ids of the removed jobs.

    • Clears a job's logs, optionally keeping the most recent keepLogs rows.

      Parameters

      • jobId: string
      • OptionalkeepLogs: number

      Returns Promise<void>

    • Builds the connection client name (used for setName and worker/queue discovery). Redis: "<prefix>:<base64(queue)><suffix>". Backends without a client-name concept may return any stable string.

      Parameters

      • Optionalsuffix: string

      Returns string

    • Closes the backend and its underlying connection(s), waiting for any in-flight work to settle.

      Parameters

      • Optionalforce: boolean

        When true, forcibly tears down the connection(s) without waiting for in-flight (e.g. blocking) commands to finish.

      Returns Promise<void>

    • Unconditionally deletes a deduplication key.

      Parameters

      • deduplicationId: string

      Returns Promise<number>

      The number of keys removed.

    • Forcibly disconnects the backend's underlying connection(s).

      Returns Promise<void>

    • Interrupts the backend's in-flight blocking wait (so a worker can stop or recover). No-op for backends without a dedicated blocking connection.

      Parameters

      • Optionalwait: boolean

      Returns Promise<void>

    • Removes waiting (and optionally delayed) jobs from the queue.

      Parameters

      • delayed: boolean

      Returns Promise<void>

    • Extends the lock of a single active job.

      Parameters

      • jobId: string
      • token: string
      • duration: number

      Returns Promise<number>

    • Extends the lock of several active jobs at once.

      Parameters

      • jobIds: string[]
      • tokens: string[]
      • duration: number

      Returns Promise<string[]>

      The ids of the jobs whose lock could not be extended.

    • Returns a sibling backend bound to a different queue (by name) that shares this backend's underlying connection(s).

      This is used by FlowProducer, which spans multiple queues over a single connection: every node in a flow needs datastore operations scoped to its own queue, but they must all reuse the same connection. The returned backend has an independent identity (its operations target the given queue) but does not own the connection, so closing it is a no-op on the shared connection.

      Parameters

      • queueName: string

        The queue the sibling backend should operate on.

      • Optionalprefix: string

        Optional key prefix for the target queue. Flows may span queues under different prefixes, so when omitted the backend's own prefix is used.

      Returns IQueueBackend

    • Returns the raw worker/client list(s) for the queue's datastore. For the Redis adapter this is CLIENT LIST (one string per cluster node, or a single string otherwise). Backends with no notion of connected clients may return an empty array.

      Returns Promise<string[]>

    • Parameters

      • priorities: number[]

      Returns Promise<number[]>

    • Returns the job id currently holding the given deduplication key, if any.

      Parameters

      • deduplicationId: string

      Returns Promise<string>

    • Returns a job's children dependencies (processed/unprocessed/ignored/failed).

      Parameters

      Returns Promise<
          {
              failed?: string[];
              ignored?: Record<string, any>;
              nextFailedCursor?: number;
              nextIgnoredCursor?: number;
              nextProcessedCursor?: number;
              nextUnprocessedCursor?: number;
              processed?: Record<string, any>;
              unprocessed?: string[];
          },
      >

    • Parameters

      • jobId: string
      • types: string[]

      Returns Promise<number[]>

    • Returns the raw ignored-children failures map (child key → reason).

      Parameters

      • jobId: string

      Returns Promise<Record<string, string>>

    • Returns a page of a job's logs together with the total log count.

      Parameters

      • jobId: string
      • start: number
      • end: number
      • asc: boolean

      Returns Promise<{ count: number; logs: string[] }>

    • Returns the raw stored metadata hash for a job scheduler.

      Parameters

      • key: string

      Returns Promise<Record<string, string>>

    • Returns the number of registered job schedulers.

      Returns Promise<number>

    • Returns a range of scheduler keys with their next-run scores, flattened as [key, score, key, score, …].

      Parameters

      • start: number
      • end: number
      • asc: boolean

      Returns Promise<string[]>

    • Parameters

      • type: "failed" | "completed"
      • Optionalstart: number
      • Optionalend: number

      Returns Promise<[string[], string[], number]>

    • Returns the raw processed-children map (child key → serialized value).

      Parameters

      • jobId: string

      Returns Promise<Record<string, string>>

    • Reads the entire queue metadata hash.

      Returns Promise<Record<string, string>>

    • Reads a single queue metadata field.

      Parameters

      • field: string

      Returns Promise<string>

    • Reads several queue metadata fields at once, in order.

      Parameters

      • fields: string[]

      Returns Promise<string[]>

    • Parameters

      • types: JobType[]
      • Optionalstart: number
      • Optionalend: number
      • Optionalasc: boolean

      Returns Promise<[string][]>

    • Returns the ttl (ms) of the current rate-limit window.

      Parameters

      • OptionalmaxJobs: number

      Returns Promise<number>

    • Returns whether a queue metadata field exists.

      Parameters

      • field: string

      Returns Promise<boolean>

    • Returns whether a job has finished and (optionally) its result.

      Parameters

      • jobId: string
      • OptionalreturnValue: boolean

      Returns Promise<number | [number, string]>

    • Returns whether a job id is present in the given state.

      Parameters

      • state: string
      • jobId: string

      Returns Promise<boolean>

    • Returns whether an id corresponds to a registered job scheduler.

      Parameters

      • id: string

      Returns Promise<boolean>

    • Returns whether the queue has reached its concurrency limit.

      Returns Promise<boolean>

    • Moves a (manually rate-limited) job from active back to wait.

      Parameters

      • jobId: string
      • Optionaltoken: string

      Returns Promise<number>

    • Recovers stalled jobs (active jobs whose lock expired) back to wait.

      Returns Promise<string[]>

      The ids of the jobs that were moved.

    • Atomically moves the next eligible job from wait/prioritized to active, returning its data (or the delay/rate-limit signals when none is ready).

      Parameters

      • token: string
      • Optionalname: string

      Returns Promise<any[]>

    • Moves an active job to the completed state and, optionally, fetches the next job to process.

      Type Parameters

      • T = any
      • R = any
      • N extends string = string

      Parameters

      • job: MinimalJob<T, R, N>
      • returnValue: R
      • removeOnComplete: number | boolean | KeepJobs
      • token: string
      • fetchNext: boolean

      Returns Promise<{ finishedOn: number; result: void | any[] }>

      The next job data tuple when fetchNext is set, plus the finishedOn timestamp that was recorded.

    • Moves a job to the delayed state, scheduling it to run after delay ms.

      Parameters

      • jobId: string
      • timestamp: number
      • delay: number
      • Optionaltoken: string
      • Optionalopts: MoveToDelayedOpts

      Returns Promise<void | any[]>

    • Moves an active job to the failed state and, optionally, fetches the next job to process.

      Type Parameters

      • T = any
      • R = any
      • N extends string = string

      Parameters

      • job: MinimalJob<T, R, N>
      • failedReason: string
      • removeOnFail: number | boolean | KeepJobs
      • token: string
      • fetchNext: boolean
      • OptionalfieldsToUpdate: Record<string, any>

      Returns Promise<{ finishedOn: number; result: void | any[] }>

      The next job data tuple when fetchNext is set, plus the finishedOn timestamp that was recorded.

    • Irreversibly destroys the queue and all of its contents.

      Parameters

      • opts: { count: number; force: boolean }

      Returns Promise<number>

      A cursor; 0 when obliteration is complete.

    • Subscribes to normalized backend lifecycle events ('ready', 'error', 'close'), derived from the underlying connection(s).

      Parameters

      • event: "error" | "close" | "ready"
      • listener: (...args: any[]) => void

      Returns this

    • Parameters

      • event: "error" | "close" | "ready"
      • listener: (...args: any[]) => void

      Returns this

    • Paginates a datastore set or hash, optionally fetching the jobs themselves.

      Parameters

      • key: string
      • opts: { end: number; fetchJobs?: boolean; start: number }

      Returns Promise<
          {
              cursor: string;
              items: { err?: string; id: string; v?: any }[];
              jobs?: JobJson[];
              total: number;
          },
      >

    • Parses a flow child/dependency node key ("<qualifiedName>:<id>") back into the components needed to locate the job: its queue keyspace prefix (empty for backends without a prefix), queueName and id. Inverse of the backend's key format; used when walking a flow tree.

      Parameters

      • key: string

      Returns { id: string; prefix: string; queueName: string }

    • Pauses or resumes the whole queue.

      Parameters

      • pause: boolean

      Returns Promise<void>

    • Promotes a single delayed job so it can be processed as soon as possible.

      Parameters

      • jobId: string

      Returns Promise<void>

    • Promotes up to count delayed jobs back to wait.

      Parameters

      • Optionalcount: number

      Returns Promise<number>

      A cursor; 0 when there are no more jobs to promote.

    • Publishes a custom event to the queue's event stream.

      Parameters

      • fields: Record<string, string | number>
      • maxEvents: number

      Returns Promise<string>

      The id of the appended event entry.

    • Blocks (up to blockTimeout ms) reading the queue's event stream for entries newer than id, returning the raw stream entries (or a falsy value on timeout). For the Redis adapter this is an XREAD ... BLOCK.

      Parameters

      • id: string
      • blockTimeout: number

      Returns Promise<[string, EntryRaw[]][]>

    • Re-establishes the backend's blocking connection after an interrupt.

      Returns Promise<void>

    • Removes a job and (optionally) its children.

      Parameters

      • jobId: string
      • removeChildren: boolean

      Returns Promise<number>

      1 if removed, 0 if it (or a dependency) was locked.

    • Removes the child→parent dependency for a not-yet-finished child.

      Parameters

      • jobId: string
      • parentKey: string

      Returns Promise<boolean>

      true if the dependency existed and was removed.

    • Removes a deduplication key if it still maps to the given job.

      Parameters

      • deduplicationId: string
      • jobId: string

      Returns Promise<number>

      1 if removed, 0 otherwise.

    • Removes the deprecated priority helper key.

      Returns Promise<number>

      The number of keys removed.

    • Parameters

      • jobSchedulerId: string

      Returns Promise<number>

    • Parameters

      • event: string
      • listener: (...args: any[]) => void

      Returns this

    • Removes orphaned job keys that exist in the datastore but are not referenced by any queue state set.

      Parameters

      • Optionalcount: number
      • Optionallimit: number

      Returns Promise<number>

      The total number of orphaned jobs removed.

    • Removes one or more queue metadata fields.

      Parameters

      • fields: string[]

      Returns Promise<number>

    • Removes the rate-limit key.

      Returns Promise<number>

      The number of keys removed.

    • Removes all unprocessed children of a job.

      Parameters

      • jobId: string

      Returns Promise<void>

    • Reprocesses a finished (failed/completed) job, moving it back to wait.

      Type Parameters

      • T = any
      • R = any
      • N extends string = string

      Parameters

      Returns Promise<void>

    • Moves up to count finished jobs of the given state back to wait.

      Parameters

      • Optionalstate: FinishedStatus
      • Optionalcount: number
      • Optionaltimestamp: number

      Returns Promise<number>

      A cursor; 0 when there are no more jobs to move.

    • Retries a failed/active job immediately by pushing it back to wait.

      Parameters

      • jobId: string
      • lifo: boolean
      • Optionaltoken: string
      • Optionalopts: RetryJobOpts

      Returns Promise<void>

    • Sets a human-readable name on the underlying connection (for observability). No-op for backends that have no such concept.

      Parameters

      • name: string

      Returns Promise<void>

    • Sets one or more queue metadata fields.

      Parameters

      • values: Record<string, string | number>

      Returns Promise<number>

    • Sets the global rate-limit window for the next jobs.

      Parameters

      • expireTimeMs: number

      Returns Promise<void>

    • Builds a namespaced sub-key/identifier of the given type for this queue (e.g. a job's "<qualifiedName>:<id>:dependencies" key).

      Parameters

      • type: string

      Returns string

    • Trims the event stream to an approximate maximum length.

      Parameters

      • maxLength: number

      Returns Promise<number>

      The number of entries removed.

    • Replaces a job's data payload.

      Type Parameters

      • T = any
      • R = any
      • N extends string = string

      Parameters

      Returns Promise<void>

    • Parameters

      • jobSchedulerId: string
      • nextMillis: number
      • templateData: string
      • delayedJobOpts: JobsOptions
      • OptionalproducerId: string

      Returns Promise<string>

    • Blocks (up to blockTimeout seconds) until the queue signals that a new job may be available, returning the next "block-until" timestamp.

      For the Redis adapter this is a BZPOPMIN on the marker sorted set using the adapter's own dedicated blocking connection; other adapters may implement it via LISTEN/NOTIFY, change-data-capture or polling.

      Parameters

      • blockTimeout: number

      Returns Promise<{ member: string; score: number }>

      The marker member/score on success, or null on timeout.

    • Resolves once the backend's underlying connection(s) are ready to accept operations.

      Returns Promise<void>