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.



  • Parameters

    • Optional options: EventEmitterOptions

    Returns CometClient


  • Disable polling features.


    • label: string

      Polling feature label.

    Returns void

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

    Returns void

  • handshake with the streaming channel


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


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


    • 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