Class EddyqModule

    NestJS module for eddyq.

    Provides an Eddyq client as a global DI token, scans providers for @Processor() + @JobHandler(kind) annotations at bootstrap, registers each handler with queue.work(), and starts the worker runtime.

    Shutdown is split across two hooks so in-flight handlers can finish cleanly even when they depend on resources owned by other modules (Drizzle, ioredis, etc.):

    1. beforeApplicationShutdown — drain the worker runtime. User modules have not yet torn down their pools, so handler code can still complete DB writes, cache reads, etc.
    2. onModuleDestroy (per user module) — user-owned pools close here.
    3. onApplicationShutdown — release the eddyq Postgres pool. Runs last; nothing else in the app needs it by this point.
    Implements
    • OnApplicationBootstrap
    • BeforeApplicationShutdown
    • OnApplicationShutdown
    Index

    Constructors

    Methods

    • Parameters

      • Optionalsignal: string

      Returns Promise<void>

    • Returns Promise<void>

    • Returns Promise<void>

    • Register a queue's per-queue config + producer handle. Call from any feature module — EddyqModule.forRoot (or forRootAsync) must be imported once at the app root for the connection + worker runtime.

      Each call adds two providers to DI:

      • the QueueRegistration value (under a namespaced token), so the aggregator can collect it at bootstrap.
      • a QueueHandle (under getQueueToken(name)), injectable via @InjectQueue(name).

      The module exports the queue-handle token so consumers in this feature module can inject it without re-importing.

      Parameters

      Returns DynamicModule