Can we make EMA follow an event based architecture?

vikneshh
vikneshh Newcomer

I am currently using EMA Java to subscribe to several ric codes. From what I have explored, we can only use a API_DISPATCH OperationModel which requires the main application thread to sleep for some time to let the EMA thread run in the background and dispatch market data events. The other OperationModel USER_DISPATCH requires us to run a while loop indefinitely and wait and manually dispatch market data events on every iteration. This results in a dedicated thread to just be waiting for events before dispatching them.

Is there any way where EMA callback methods can receive messages just based on incoming events without the application thread having to sleep or dispatch on every iteration?


Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @vikneshh

    Thank you for reaching out to us.

    I think EMA is a dispatching model. It requires a thread to dispatch events and run the code in the callback methods. This thread could be an application thread (USER_DISPATCH), or an API thread (API_DISPATCH).