Skip to content

basalt / queue/src / queuedOn

Function: queuedOn() ​

> queuedOn<T>(bus, manager, event, handler, options?): () => void

Defined in: queue/src/bridge.ts:27

The events→queue bridge: the listener becomes a job — emit only enqueues, and the handler runs in the worker with the driver's retry/backoff and the context (tenant/requestId) restored.

queuedOn(bus, queue, OrderCreated, async ({ orderId }) => { ... })

Returns the listener's unsubscribe function.

Type Parameters ​

T ​

T

Parameters ​

bus ​

EventBus

manager ​

QueueManager

event ​

BasaltEvent<T>

handler ​

(payload) => void | Promise<void>

options? ​

QueuedListenerOptions = {}

Returns ​

() => void

Released under the MIT License.