The order book maintenance is configurable.
Sometimes there is a need to build and maintain order books independently (e.g., an application uses a custom order book structure).
Book atomic updates represent the same elementary quants of market data as trades and statistics do.
The handler notifies on atomic updates into a book via the OnixS::CME::MDH::SecurityListener::onBookAtomicUpdate members. The listener instance can be registered using the OnixS::CME::MDH::HandlerListeners::security member. The corresponding event describes elementary operations on bids or offers.
An atomic order book update is reported to client code via the OnixS::CME::MDH::SecurityListener::onBookAtomicUpdate member and represents an elementary operation over an order book. Therefore, the OnixS::CME::MDH::SecurityListener::onBookAtomicUpdate may be invoked more frequently than the OnixS::CME::MDH::SecurityListener::onBookUpdate member. The OnixS::CME::MDH::SecurityListener::onBookAtomicUpdate member usually is invoked several times before a single invoke of the OnixS::CME::MDH::SecurityListener::onBookUpdate is done.
When the handler processes all atomic updates belonging to a single market event, an order book reaches a valid state. The OnixS::CME::MDH::SecurityListener::onBookUpdate callbacks are called only when the handler processes all atomic updates, so the books are valid and up-to-date.
Listening to the handler events is necessary to build an order book correctly. The handler may start the market state recovery when an error or data loss occurs. Therefore, if the handler invokes the OnixS::CME::MDH::HandlerListener::onMarketRecovery member, all books for all securities belonging to the channel must be empty. Afterwards, the handler will provide atomic updates received via Snapshot messages.