The Handler class's primary purpose is to process market data transmitted by the MDP and deliver the results to the user for further analysis and processing.
The Handler uses a concept of events and event listeners to notify a client code about a particular occasion like the reception of security definition or direct book update.
For a better experience, the SDK groups all events and provides C++ classes with virtual members for each of those groups. Client code may override any or all listener members to implement its reaction for a particular event. For each listener, the Handler exposes a particular parameter like the OnixS::CME::ConflatedUDP::HandlerListeners::security which allows associating an event listener with an appropriate group of events for a particular instance of the OnixS::CME::ConflatedUDP::Handler class.
The SDK does not use pure virtual functions. Instead, each callback referring to a particular event has an empty body, thus providing default (empty) behavior. That lets users override events they need, thus making code more clear and readable.
Associating event listener with an instance of the OnixS::CME::ConflatedUDP::Handler class is also called subscribing to events.
The table below describes primary groups of events exposed by the Handler as well as depicts correspondence between the events, interfaces for listeners and the settings path to subscribe to the chosen event group:
Listener | Listener Parameter | Description |
---|---|---|
OnixS::CME::ConflatedUDP::HandlerListener | OnixS::CME::ConflatedUDP::HandlerListeners::handler Path in the Handler's settings: | The Handler triggers the given events during market data processing. Events reflect different processing session stages like entering or leaving the recovery cycle, recovery completion status (OnixS::CME::ConflatedUDP::RecoveryCompletionArgs), and resuming real-time data processing. |
OnixS::CME::ConflatedUDP::MarketDataListener | OnixS::CME::ConflatedUDP::HandlerListeners::marketData Path in the Handler's settings: | The Handler invokes the given listener members when it begins or ends processing various market data entities like a packet or a message. An important aspect related to the given listener is that events are triggered only for market data accepted by the Handler and according to CME's rules. The Handler does not invoke members of the listener for any duplicated or out-of-order packets. The given listener provides additional flexibility for the users while implementing their trading strategies without requiring new events. |
OnixS::CME::ConflatedUDP::SecurityListener | OnixS::CME::ConflatedUDP::HandlerListeners::security Path in the Handler's settings: | Members of the given listener are invoked to reflect security-related events like the reception of trade, security status, and order book update. Each member exposed by the given listener provides read-only access to security base attributes like its id, group, symbol, and a security-level sequence number for tracking correctness of processing market data referring to the given security. By default, members of the given listener are invoked for each security available on the channel. However, it is possible to restrict callback invocation for a set of securities using the OnixS::CME::ConflatedUDP::Handler::selectInstruments member. See Selecting Securities of Interest for more information. |
OnixS::CME::ConflatedUDP::ChannelFeedListener | OnixS::CME::ConflatedUDP::HandlerListeners::feeds Path in the Handler's settings: | The OnixS::CME::ConflatedUDP::ChannelFeedListener members are invoked by the Handler each time a feed-related event occurs. Feeds are used by the Handler while processing market data transmitted by CME MDP. |