Beignet API reference
    Preparing search index...

    Interface CreateBullMQJobWorkerOptions<Ctx>

    Options for creating a BullMQ worker over Beignet job definitions.

    interface CreateBullMQJobWorkerOptions<Ctx> {
        connection?: ConnectionOptions;
        ctx: BullMQJobWorkerContext<Ctx>;
        errorReporter?: BullMQJobWorkerErrorReporter<Ctx>;
        hooks?: readonly JobHook<JobDef<string, StandardSchema, Ctx>, Ctx>[];
        infrastructureErrorReporter?: ErrorReporterPort;
        instrumentation?: ProviderInstrumentationTarget;
        jobs: readonly JobDef<string, StandardSchema, Ctx>[];
        prefix?: string;
        queueName: string;
        redisUrl?: string;
        workerOptions?: BullMQJobWorkerOptions;
    }

    Type Parameters

    • Ctx
    Index
    connection?: ConnectionOptions

    Explicit BullMQ connection options. Use either redisUrl, connection, or workerOptions.connection.

    Static app context or per-job context factory.

    Optional error reporter used for job failures. A direct port can report failures before app context exists; a resolver is used after context has been created. Reporter failures are swallowed so BullMQ failure handling stays authoritative.

    hooks?: readonly JobHook<JobDef<string, StandardSchema, Ctx>, Ctx>[]

    Hooks that wrap every job attempt executed by this worker. Worker hooks wrap job-local hooks.

    infrastructureErrorReporter?: ErrorReporterPort

    Context-free fallback for validation, context-construction, and unknown-job failures, plus worker infrastructure errors, stalled jobs, and shutdown failures. Reporter failures are isolated from worker behavior.

    Optional provider instrumentation target.

    jobs: readonly JobDef<string, StandardSchema, Ctx>[]

    Job definitions this worker is allowed to execute. Retry policies are validated eagerly, so a job with retry options BullMQ cannot honor throws at worker creation instead of at first dispatch or processing.

    prefix?: string

    Redis key prefix. Defaults to "beignet" to match the provider default.

    queueName: string

    BullMQ queue name to consume.

    redisUrl?: string

    Redis connection URL. Use this when the worker should share BULLMQ_REDIS_URL with the provider entrypoint.

    workerOptions?: BullMQJobWorkerOptions

    BullMQ worker options. Pass autorun: false when the process should call worker.run() manually.