Message Handler
constructor(messageBus: MessageBus, scope: CoroutineScope, topic: Topic<T>, handleError: suspend (Throwable) -> Unit = {}, handleMessage: suspend (message: T) -> Unit)
Parameters
message Bus
The MessageBus instance the handler subscribes to.
scope
The CoroutineScope in which the handler operates.
topic
The Topic that the handler subscribes to for receiving messages.
handle Error
Function for handling errors that occur during execution of handleMessage. Errors do not cause the flow to complete.
handle Message
A suspending function invoked for each received message associated with the given topic.
Type Parameters
T
The type of messages to handle, constrained to non-nullable types.