Rate this page:

StreamingAgent

Represents a streaming object to interact with streaming platforms. Add the following line to your scenario code to use the class:

require(Modules.StreamingAgent);

Methods

addEventListener

Copy URL
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

  • type:

    void

removeEventListener

Copy URL
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

  • type:

    void

stop

Copy URL
stop(): 

void

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

Returns

  • type:

    void