listen
Registers a handler to listen for messages of a specific type.
Return
an AutoCloseable that can be used to unregister the handler.
Parameters
T
the type of the message to listen for.
handler
the handler to process incoming messages.
Registers a handler to listen for messages of a specific type.
Return
an AutoCloseable that can be used to unregister the handler.
Parameters
T
the type of the message to listen for.
type
the KClass representing the type of the message.
handler
the suspend function to process incoming messages.