Class CometClientAbstract

Comet client interface. The is to allow for mocking the inner streaming Cometd implementation. The Faye implementation is used by default but it could be used to adapt another Cometd impl.

Hierarchy

Constructors

  • Parameters

    • Optional options: EventEmitterOptions

    Returns CometClient

Methods

  • Disable polling features.

    Parameters

    • label: string

      Polling feature label.

    Returns void

  • Method to call to disconnect the client from the server.

    Returns void

  • handshake with the streaming channel

    Parameters

    • callback: (() => void)

      Callback for the handshake when it successfully completes. The handshake should throw errors when errors are encountered.

        • (): void
        • Returns void

    Returns void

  • Sets an http header name/value.

    Parameters

    • name: string

      The header name.

    • value: string

      The header value.

    Returns void

  • Subscribes to Comet topics. Subscribe should perform a handshake if one hasn't been performed yet.

    Parameters

    • channel: string

      The topic to subscribe to.

    • callback: ((message) => void)

      The callback to execute once a message has been received.

        • (message): void
        • Parameters

          • message: JsonMap

          Returns void

    Returns CometSubscription