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;
}
Properties
OptionalautoStart
Call eddyq.start() automatically during onApplicationBootstrap. Default true.
Set false if you want to register handlers dynamically before starting.
OptionalconnectOptions
Pool / migration-line options forwarded to Eddyq.connect. (Postgres only.)
OptionaldatabaseUrl
Postgres URL. Set this for a Postgres-only app, or alongside redis
for a multi-backend app (route per-queue via queues).
OptionaldefaultProvider
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.
OptionalgracefulShutdownMs
Millisecond budget for graceful shutdown before force-cancelling. Default 30_000.
Optionalqueues
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" }]
Optionalredis
Redis backend config. Set this for a Redis-only app, or alongside
databaseUrl for a multi-backend app.
OptionalrunMigrations
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.
Optionalschedules
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).
OptionalshutdownMode
How onApplicationShutdown releases the worker pool.
"drain"(default) — wait up togracefulShutdownMsfor in-flight handlers to finish. Best for routine deploys."force"— abort the runtime immediately and proactively reclaim any in-flight DB rows (setrunning→pending) 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 afterstaleAfter. Use only on panic exits.
OptionalskipMigrationCheck
Skip the pending-migration guard start() normally enforces. Default false.
See StartOptions.skipMigrationCheck in @eddyq/queue.
OptionalsubscribeTo
Named queues to subscribe this worker to. Default ["default"].
Optionaltuning
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.
OptionalworkerConcurrency
Max in-flight jobs per Node process. Default from core: 10.
Options accepted by
EddyqModule.forRoot.