Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TopicUpdateHandler

The TopicUpdateHandler interface for exclusive updates. This interface must be implemented by the user, to be registered via TopicControl.registerUpdateSource.

A topic update handler has a lifecycle that reflects the registration state on the server. This is expressed through the callback methods. Once onClose has been called, no further interactions will occur.

When an update handler is registered it will be notified via the onRegister callback. Once registered it may be in either a active state, where it can provide topic updates, or a standby state, where it is still registered but is not allowed to perform updates. The state may be switched in any order, depending on server policy.

class

TopicUpdateHandler

deprecated

since 6.2

This class is deprecated. It is only used in conjunction with TopicControl.registerUpdateSource. Use TopicUpdate.createUpdateStream instead. This method will be removed in a future release.

Hierarchy

  • TopicUpdateHandler

Index

Methods

onActive

  • onActive(path: string, updater: Updater): void
  • State notification that this handler is now active for the specified topic path and is therefore in a valid state to send updates on topic at or below the registered topic path

    Parameters

    • path: string

      the registration path

    • updater: Updater

      an updater that can be used to update topics

    Returns void

onClose

  • Called when the handler is closed. The handler will be closed if the session is closed, or if the handler is unregistered.

    Once closed, no further calls will be made for the handler.

    Parameters

    • path: string

      the registration path

    • Optional errorReason: ErrorReasonType

      an optional value representing the error; this can be one of the constants defined in ErrorReason, or a feature-specific reason. It is absent if the handler was closed because the session closed.

    Returns void

onRegister

  • onRegister(path: string, deregister: function): void
  • Called when the handler has been successfully registered with the server.

    A session can register a single handler for a given branch of the topic tree. If there is already a handler registered for the topic path the operation will fail and onClose will be called.

    To deregister the handler, call the deregister function supplied.

    Parameters

    • path: string

      the path that the handler is registered for

    • deregister: function

      a function that may be called to deregister this handler

        • (): void
        • Returns void

    Returns void

onStandBy

  • onStandBy(path: string): void
  • State notification that this handler is not currently allowed to provide topic updates for the specified topic path. This indicates that another TopicUpdateHandler is currently active for the given topic path.

    Server policy will dictate when this handler is set as active.

    If this handler was previously in a active state, any Updater instances for this topic path will no longer be valid for use.

    Parameters

    • path: string

      the registration path

    Returns void