question

Upvotes
Accepted
5 1 1 2

Are onRefreshMsg, onUpdateMsg and onStatusMsg callbacks guaranteed to be always called on the same single thread

We have a simple C++ application that uses EMA API to collect market data from Refinitiv. In it we create a single OmmConsumer object and a single OmmConsumerClient object. Following that we make multiple OmmConsumer.registerClient() calls to subscribe to different symbols (We subscribe in the main thread).

My question being are we guaranteed that the onRefreshMsg, onUpdateMsg and onStatusMsg callback functions will always be called on the same singe thread.

elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvotes
Accepted
13k 32 12 18

Hi @johnson. The EMA/ETA SDK is open source and you can view the source code on github.

While I assume those event callbacks are being handled by the same thread, I don't think any specific effort is made to do so. If you want to ensure that event dispatch is always in the same thread, then please look into UserDispatch Mode of the API. In this mode, your application thread will invoke the callbacks. See the EMA example 130__MarketPrice__UserDisp shipped with SDK on how to implement this.


OmmConsumer consumer( OmmConsumerConfig().operationModel( OmmConsumerConfig::UserDispatchEnum ).host( .....
consumer.registerClient( ....
while(1)
   consumer.dispatch(10);        // calls to onRefreshMsg(), onUpdateMsg(), or onStatusMsg() execute on this thread


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea