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

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.

Best Answer

  • 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