SIGN UP

StreamingAgent

Represents a streaming object to interact with streaming platforms.

Methods

addEventListener

addEventListener(event: StreamingAgentEvents, callback: Function): void

Adds a handler for the specified event triggered by a streaming object.

Parameters

  • Streaming event, e.g., StreamError.

  • callback:

    Function

    Handler function that can take one parameter – the object with event information

Returns

  • Return:

    void

removeEventListener

removeEventListener(event: StreamingAgentEvents, callback: Function): void

Removes a handler for the specified event triggered by a streaming object.

Parameters

  • Streaming event, e.g., StreamError.

  • callback:

    Function
    OPTIONAL

    Handler function that can take one parameter – the object with event information

Returns

  • Return:

    void

stop

stop(): void

Stops streaming. Triggers the StreamStopped event. You must not call any other streaming methods after a StreamingAgent.stop call.

Returns

  • Return:

    void