eventBus
Creates messaging client reader for LOCAL transport layer (Event Bus)
Importing
import { eventBus } from '@marblejs/messaging';Type declaration
eventBus :: EventBusConfig
-> Reader<Context, Promise<TransportLayerConnection>>Parameters
parameter
definition
config
EventBusConfig
EventBusConfig
parameter
definition
listener
<optional> MessagingListener
Because of asynchronous nature of messaging client, all related readers have to be bound to server creators via eager binding 👉 #bindEagerlyTo
To learn more about eventBus usage please visit:
Example
The event bus can be attached to server creator, like basic HTTP or any other microservice.
@marblejs/messaging module exposes already existing messaging client for eventBus transport layer:
Additionally it exports tokens for both EventBus and EventBusClient instances.
Last updated