Once the Handler is started, it processes securities definitions retrieved either from multicast channel or locally stored file cache. Afterwards, the Handler starts listening for a book-related market data. At first, Handler reconstructs all (direct or implied or both) books for all available securities. Once reconstruction is accomplished, Handler listen for an incremental updates and processes them accordingly.
To get understanding in which state the Handler currently is, it's necessary to implement OnixS::CME::MarketData::HandlerStateChangeListener class interface and associate an instance with the Handler using OnixS::CME::MarketData::Handler::registerStateChangeListener member.
Below table describes all possible states for the Handler:
State | Description |
OnixS::CME::MarketData::HandlerState::Stopped | Handler is stopped or was not executed yet. |
OnixS::CME::MarketData::HandlerState::SecurityDefinitionsRecoveryStarted | Handler started gathering security definitions either from multicast feed or locally stored file cache. |
OnixS::CME::MarketData::HandlerState::SecurityDefinitionsRecoveryFinished | Handler accomplished processing of security definitions. In normal flow Handler moves to the BooksResynchronizationStarted right after it achieves SecurityDefinitionsRecoveryFinished state. However, in certain cases (for example, in case of error while processing security definitions) Handler may move back to the SecurityDefinitionsRecoveryStarted state. |
OnixS::CME::MarketData::HandlerState::BooksResynchronizationStarted | Handler switches to this state when it joins the system for a market data and starts building the books for all securities whose definitions were obtained on previous stage. Also, Handler may move into this stage in case of message gap detection while maintaining books.
|
OnixS::CME::MarketData::HandlerState::BooksResynchronizationFinished | Handler accomplished process of books resynchronization. Since this moment all books are valid and are in the up-to-date state. Handler continues to listen for any changes in the books and notifies about updates through appropriate listeners. |
OnixS::CME::MarketData::HandlerState::TcpReplayStarted | Because of multicast unreliability, message gap may happen while processing market data. If the Handler is configured to use TCP Replay facility, it suspends regular processing, moves to this state and requests remote system to resend missed messages. TCP Replay is not a performance-based recovery option and should only be used if other options are unavailable. |
OnixS::CME::MarketData::HandlerState::TcpReplayFinished | Handler switches into this state in case of successful recover from message gap using TCP replay facility. Afterwards, normal market data processing is restored and Handler continues listening for books updates. |