question

Upvotes
Accepted
5 2 3 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-sdkema-apirrtelektron-message-api
icon clock
10 |1500

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

@johnson

Hi,

Thank you for your participation in the forum.

Is the reply below satisfactory in answering your question?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
22.1k 59 14 21

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 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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