Skip to content

API reference / @node-ts/bus-core / CustomHandler

Interface: CustomHandler<TMessage> ​

Defined in: packages/bus-core/src/handler/custom-handler.ts:7

A handler that handles messages defined externally to the system, that don't extend from the Message base

Type Parameters ​

Type ParameterDefault type
TMessageany

Methods ​

handle() ​

ts
handle(
   message, 
   attributes, 
   context
): unknown;

Defined in: packages/bus-core/src/handler/custom-handler.ts:15

Called each time a message that this handler's resolver matches is received

Parameters ​

ParameterTypeDescription
messageTMessageThe message read from the bus
attributesMessageAttributesAttributes of the message read from the bus
contextHandlerContextSends, publishes, fails or returns messages through the bus that received the message

Returns ​

unknown

Anything. A returned promise is awaited, and the value it resolves to is ignored

Released under the MIT License.