Class: RouterEventHandler<IncomingEventType, OutgoingResponseType>
Class: RouterEventHandler<IncomingEventType, OutgoingResponseType>
A router event handler for processing incoming events.
Type Parameters
IncomingEventType
IncomingEventType
extends StoneIncomingEvent
= StoneIncomingEvent
The type representing the incoming event.
OutgoingResponseType
OutgoingResponseType
= unknown
The type representing the outgoing response.
Implements
IEventHandler
<IncomingEventType
,OutgoingResponseType
>
Constructors
Constructor
protected new RouterEventHandler<IncomingEventType, OutgoingResponseType>(options): RouterEventHandler<IncomingEventType, OutgoingResponseType>;
Constructs a RouterEventHandler
instance.
Parameters
options
RouterEventHandlerOptions
<IncomingEventType
, OutgoingResponseType
>
The RouterEventHandler options including blueprint, container, and event emitter.
Returns
RouterEventHandler
<IncomingEventType
, OutgoingResponseType
>
Methods
handle()
handle(event): Promise<OutgoingResponseType>;
Handle an incoming event.
Parameters
event
IncomingEventType
The incoming event to process.
Returns
Promise
<OutgoingResponseType
>
The outgoing response.
Implementation of
IEventHandler.handle