Skip to main content

Module book

Module book 

Source
Expand description

Shared order book synchronization, recovery, and conformance checks.

  • sync holds the per-book synchronization lifecycle and its contract.
  • recovery owns recovery episodes, the retry budget, and the retry ceiling that follows it.
  • snapshot coordinates subscription write confirmation with snapshot acceptance and deadlines.
  • BookSequenceOutcome and BookSyncSignal describe validation decisions and monitoring signals without carrying venue-specific sequence fields or channel types.
  • conformance (test support) checks emitted book output against the book stream contract.

§Recovery Lifecycle

The adapter validates incoming book frames and marks gaps through BookSync, which requests recovery while nothing owns the book. A request grants no ownership: the adapter then claims an episode and runs it. The recovery runner requests replacement snapshots through an adapter-supplied operation until the adapter accepts one or the episode is cancelled; a book never ends in a terminal failure state. A confirmed write opens the snapshot gate; only an accepted fresh snapshot completes recovery.

§Adapters

Adapters retain sequence rules, venue positions, buffers, socket routing, wire commands, acknowledgement correlation, and error classification. They keep BookSync under their existing lock or owning task.

A monitoring signal does not itself start recovery; the adapter decides how to respond.

Modules§

conformance
Output checks for the order book stream contract.
recovery
Recovery ownership and replacement attempts for one book.
snapshot
Subscription write gates and pending snapshot lifetimes.
sync
Synchronization lifecycle of one subscribed book.

Structs§

BookSyncSignal
A monitoring signal for one book.

Enums§

BookSequenceOutcome
Decision from an adapter’s book sequence validation.
BookSyncSignalKind
Condition reported while monitoring book synchronization.

Constants§

DEFAULT_BOOK_SNAPSHOT_TIMEOUT_SECS
Default wait for an initial, post-reconnect, or recovery order book snapshot, in seconds.