How to identify if all the subscribed symbols in the OmmArray has received refresh message? How ...

How to identify if all the subscribed symbols in the OmmArray has received refresh message? How to exit after receiving refresh message of all the subscribed symbols?

Best Answer

  • zoya faberov
    zoya faberov ✭✭✭✭✭
    Answer ✓

    Hello @yajnasteju,

    If you require a streaming update,

    I would take a generic approach, not specific to Elektron, rather analogous to other use cases for asynchronous processing of multiple parallel requests. I would keep a map of requested symbols, and mark completion on each receipt of either data refresh or negative status. Once all the responses have been received, I would unitialize the consumer and exit.

    If you are only looking for a single refresh for each symbol, I would consider a snapshot request, interest after refresh = false.