Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MessageHandler

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.

deprecated

since 6.2

        One-way messaging is deprecated in favor of request-response
        messaging. See <a href="messages.html#sendrequest">sendRequest</a>
        and <a href="messages.html#sendrequesttofilter">            sendRequestToFilter</a>. This interface will be removed in a future
        release.

Hierarchy

  • MessageHandler

Index

Methods

onActive

  • onActive(unregister: function): void
  • Called when the handler has been registered at the server and is now active.

    Parameters

    • unregister: function

      a function to call that will unregister and close this handler

        • (): void
        • Returns void

    Returns void

onClose

  • onClose(): void
  • Called when the handler is unregistered, or the session is closed.

    Returns void

onMessage

  • 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.

    function

    Session.messages.MessageHandler.onMessage

    Parameters

    Returns void