LSEG Data Library for TypeScript

onStatus

Attaches an event handler function to the stream, which will be called when the state of the stream changes.

Syntax

stream.onStatus(callback: RDPStreamAckCb)

Parameters

Value Description Data type Optional Default value
callback RDPStreamAckCb function (see RDPStream.Event). function No -

Returned value

The current RDPStream object.

Usage

The following example demonstrates how to display messages received when the stream status is changed:

const stream = Delivery.RDPStream.Definition({
    universe: 'R.BP.L',
    parameters: { universeType: 'Symbol' },
}).getStream();

await stream
    .onStatus((data, stream) => console.log(data, stream))
    .open();

OmmStream.Event

55 words (0:17 mins)