fun on(event: String, callback: (Message) -> Unit): Ref
Register a callback on arbitrary event
Note: the callback might be called on another thread
event
- The event to register the callback for
callback
- A callback called when the channel receive a
message for the given event
Return
A ref that can be used with Channel.off