BookUpdateBus¶
BookUpdateBus is a fan-out event channel for BookUpdateEvent messages, wrapped in pooled Handles for zero-allocation delivery across components such as order books, strategies, and analytics.
#ifdef FLOX_USE_SYNC_BOOK_UPDATE_BUS
using BookUpdateBus = EventBus<pool::Handle<BookUpdateEvent>, SyncPolicy<...>>;
#else
using BookUpdateBus = EventBus<pool::Handle<BookUpdateEvent>, AsyncPolicy<...>>;
#endif
Purpose¶
- Efficiently distribute
BookUpdateEvents to multiple subscribers with zero allocations in the hot path.
Responsibilities¶
| Aspect | Details |
|---|---|
| Payload | Uses pool::Handle<BookUpdateEvent> for memory reuse and ref-counting. |
| Mode | SyncPolicy or AsyncPolicy, toggled by FLOX_USE_SYNC_BOOK_UPDATE_BUS. |
| Target | Consumed by order book processors, strategies, and market monitors. |
Notes¶
SyncPolicyenforces barrier-based delivery (e.g., for simulation or determinism).AsyncPolicysupports lock-free fan-out under production latency constraints.- Pooling ensures
BookUpdateEvents are reused without dynamic heap allocations. - Designed for high-frequency message flow in HFT environments.