Stratal API Reference
    Preparing search index...

    Interface IQueueSender

    Queue sender interface for dispatching messages to a queue.

    Each IQueueSender instance is bound to a specific queue name. Messages are dispatched with auto-generated id, timestamp, and locale metadata.

    // Injected via @InjectQueue or token binding
    constructor(
    @InjectQueue('notifications-queue') private queue: IQueueSender
    ) {}

    // Dispatch a message
    await this.queue.dispatch({
    type: 'email.send',
    payload: {
    to: 'user@example.com',
    subject: 'Welcome',
    html: '<h1>Hello!</h1>'
    }
    })
    interface IQueueSender {
        dispatch<T>(message: DispatchMessage<T>): Promise<void>;
    }

    Implemented by

    Index

    Methods

    Methods