The handler interface for receiving messages sent from sessions to the server. This interface must be implemented by the user, to be registered via Messages.addHandler.
A message handler has a lifecycle that reflects the registration state on the server. This is expressed through the callback methods. Once onClose has been closed, no further interactions will occur.
Messages received by a handler contain the identity of the original sender.
Called when the handler has been registered at the server and is now active.
a function to call that will unregister and close this handler
Called when the handler is unregistered, or the session is closed.
Handle a message that was sent by another session to the server, on a path that is a descendant of the path which this handler is registered for.
The received message