Interface EddyqModuleOptions

    Options accepted by EddyqModule.forRoot.

    interface EddyqModuleOptions {
        autoStart?: boolean;
        connectOptions?: ConnectOptions;
        databaseUrl?: string;
        defaultProvider?: "postgres" | "redis";
        gracefulShutdownMs?: number;
        queues?: EddyqQueueRoute[];
        redis?: EddyqRedisOptions;
        runMigrations?: boolean;
        schedules?: ScheduleDeclaration[];
        shutdownMode?: "drain" | "force" | "abandon";
        skipMigrationCheck?: boolean;
        subscribeTo?: string[];
        tuning?: EddyqTuningOptions;
        workerConcurrency?: number;
    }
    Index

    Properties

    autoStart?: boolean

    Call eddyq.start() automatically during onApplicationBootstrap. Default true. Set false if you want to register handlers dynamically before starting.

    connectOptions?: ConnectOptions

    Pool / migration-line options forwarded to Eddyq.connect. (Postgres only.)

    databaseUrl?: string

    Postgres URL. Set this for a Postgres-only app, or alongside redis for a multi-backend app (route per-queue via queues).

    defaultProvider?: "postgres" | "redis"

    Default provider for queues not listed in queues. Required when both backends are configured (or there's no way to pick on enqueue). Ignored in single-backend setups.

    gracefulShutdownMs?: number

    Millisecond budget for graceful shutdown before force-cancelling. Default 30_000.

    queues?: EddyqQueueRoute[]

    Per-queue → provider routing. Required when both databaseUrl and redis are set; otherwise ignored. Queues not listed here fall back to defaultProvider.

    Example: queues: [{ name: "webhooks", provider: "redis" }, { name: "payments", provider: "postgres" }]

    Redis backend config. Set this for a Redis-only app, or alongside databaseUrl for a multi-backend app.

    runMigrations?: boolean

    Run pending migrations before start(). Default false — migrations are a deploy-step concern, not a runtime one. Flip on only for toy apps or tests.

    schedules?: ScheduleDeclaration[]

    Cron schedules declared in code. When provided, the module reconciles the DB against this list at boot — entries are upserted, and any DB schedule not in the list is deleted. Pass [] to delete all declared schedules; omit to leave schedules untouched (useful when managing them imperatively via queue.addSchedule).

    shutdownMode?: "drain" | "force" | "abandon"

    How onApplicationShutdown releases the worker pool.

    • "drain" (default) — wait up to gracefulShutdownMs for in-flight handlers to finish. Best for routine deploys.
    • "force" — abort the runtime immediately and proactively reclaim any in-flight DB rows (set runningpending) so other pods pick them up without waiting for heartbeat sweep. Use when SIGKILL is imminent.
    • "abandon" — drop the runtime without touching DB rows. The next pod's heartbeat sweep recovers them after staleAfter. Use only on panic exits.
    skipMigrationCheck?: boolean

    Skip the pending-migration guard start() normally enforces. Default false. See StartOptions.skipMigrationCheck in @eddyq/queue.

    subscribeTo?: string[]

    Named queues to subscribe this worker to. Default ["default"].

    Worker-runtime tuning forwarded to eddyq.start() — sweep/cleanup intervals, retention windows, lease durations, etc. Omit to use defaults. skipMigrationCheck is not included here; set it at the top level.

    workerConcurrency?: number

    Max in-flight jobs per Node process. Default from core: 10.