💬 The name of this handler which is used at a possible EventCombiner
💬 indicates if a DomainEvent has at least once been fired
💬 Dispatches a DomainEvent.
Therefore, all Subscribers callbacks are called with the given optional payload
.
(optional) payload to broadcast to all Subscribers
Protected
logProtected
log💬 log when a subscription is notified.
subscribe()
)Protected
logProtected
log💬 Subscribes the given callback
to this handler, so that its called on dispatch.
of the calling Subscriber
to call if the event has been dispatched
suppresses the usage of the extendable logging functionality of this handler
Generated using TypeDoc
A Handler that allows subscribers (any caller) to subscribe to a specific event
All subscribers will be notified if the EventHandler dispatched the event.
Example
At first the EventHandler has to be created with a unique name that subscribes the purpose.
<void>
EventCombiner
sTo receive messages from the handler, a subscription has to be made with a unique name.
event
which is provided in the callback is aDomainEvent
with the dispatched payload (typed)To send messages a dispatch with the correctly typed value has to be made.
When a Subscription is unsubscribed, the callback will no longer be called
Logging
To use the logging functionality the handler has to be extended to activate the following logging methods:
protected logSubscribe(name: string)
- log when.subscribe()
is calledprotected logUnsubscribe(name: string)
- log when.unsubscribe()
is calledprotected logDispatch()
- log whendispatch()
is calledprotected logDispatchedSubscription(subscription: Subscription<Payload>)
- log when a subscription is notified