|Understanding Handler States|
Once the Handler is started, it processes securities definitions retrieved
from TCP connection. Afterwards, the Handler starts listening for a book-related
market data. At first, the Handler reconstructs all the books for all available
securities. Once reconstruction is accomplished, the Handler listen for an
incremental updates and processes them accordingly.
The table below describes all possible states for the Handler:
The Handler is stopped or was not executed yet.
The Handler is stopping.
The Handler is started, but no data processing is performed yet.
The Handler started gathering product definitions from TCP stream.
The Handler accomplished processing of product definitions.
In normal flow Handler moves to the
right after it achieves
state. However, in certain cases (for example, in case of
error while processing product definitions) the Handler may
move to the Stopping state.
The 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, the Handler may move into this stage in case of message
GAP detection while maintaining books.
Once the Handler moves into this state, books of all types
for all securities are no longer valid and are wiped by the
Handler. Since this moment Handler starts to rebuild all
books from the scratch.
The Handler accomplished process of the book recovery.
Since this moment all the books are valid and are in the
up-to-date state. The Handler continues to listen for any
changes in the books and notifies about updates through
|Handler States Diagram