Refinitiv Data Library for TypeScript

OMMStream.Definition

Summary

This method creates a Definition that can be used to get OMMStream that can be used to subscribe to streaming items of any Domain Model (e.g. MarkePrice, MarketByPrice...) exposed by the underlying WebSocket protocol of the Refinitiv Data Platform.

Methods

OMMStream.Definition(name: string)

Allows you to create a short definition for OMMStream

Parameters:

Name Is Optional Default Value Type Description
name No - string Name of the streaming instrument

Returned value: a new instance of OMMStream Definition.


OMMStream.Definition(params: OMMStreamRequestParams)

Allows you to create a full definition for OMMStream

OMMStreamParams properties:

Name Default Value Description
name - Name of the streaming instrument
service Defined within the streaming platform Offers the ability to use specific service to manage the real-time streaming data
domain MarketPrice Defines the domain for the specific data of interest. For example, MarketPrice, MarketByPrice, MarketByOrder, etc
api true Specifies the data source. It can be updated/added using config file
streaming true Specifies whether the stream will deliver the initial image following by updates. A value of false implies no streaming and that only the initial image will be delivered
fields All fields Specifies the specific fields delivered when messages arrive
extendedParams - Specifies the parameters that will be merged with the request

Returned value:a new instance of OMMStream Definition.


getStream(session: Session)

Parameters:

Name Is Optional Default Value Type Description
session No - Session The Session used by the OMMStream to retrieve data from the platform

Returned value: OMMStream that uses the given session.


Exaple of usage

const ommStream = OMMStream.Definition(
    {
        name: 'EUR=',
        fields: ['DSPLY_NAME', 'PRCTCK_1', 'TRDPRC_1', 'PCTCHNG', 'HIGH_1', 'LOW_1']
    }
).getStream(session);

const ommStream2 = OMMStream.Definition('EUR=').getStream(session);