Stratal API Reference
    Preparing search index...

    Function InjectQueue

    • Inject a queue sender by name.

      Queue names are typed via module augmentation of QueueNames interface. The queue name serves as both the identifier and the DI injection token.

      Parameters

      • name: string

        Queue name (typed with autocomplete if QueueNames is augmented)

      Returns ParameterDecorator

      Parameter decorator for constructor injection

      // Direct injection by queue name
      constructor(
      @InjectQueue('notifications-queue') private queue: IQueueSender
      ) {}

      // Usage
      await this.queue.dispatch({
      type: 'email.send',
      payload: { to: 'user@example.com', subject: 'Hello' }
      })

      The queue must be registered via QueueModule.registerQueue(name) before injection. For module-internal queue bindings (e.g., EmailModule), use @inject(TOKEN) with useExisting provider binding instead.