Lifecycle hooks
@node-ts/bus exposes a number of lifecycle hooks that can be subscribed to. These are EventEmitter instances that follow the standard node .on()
and .off()
notation.
Hooks
beforeSend
called just before a command is sent to the underlying transport
beforePublish
called just before a event is published to the underlying transport
afterReceive
called after a message has been read from the queue, and before it is dispatched to handlers
beforeDispatch
called before a message is dispatched to its handlers
afterDispatch
called after a message has been successfully handled and the message deleted from the transport
onError
called when an error occurred reading/dispatching/handling a message
Last updated