OrderExecutionBus¶
OrderExecutionBus is the delivery channel for OrderEvent messages, used to notify downstream components (e.g. PnL trackers, position managers) about order lifecycle events.
#ifdef FLOX_USE_SYNC_ORDER_BUS
using OrderExecutionBus = EventBus<OrderEvent, SyncPolicy<OrderEvent>>;
#else
using OrderExecutionBus = EventBus<OrderEvent, AsyncPolicy<OrderEvent>>;
#endif
Purpose¶
- Fan-out dispatch of
OrderEvents to registered execution listeners with selectable sync/async policy.
Responsibilities¶
| Aspect | Description |
|---|---|
| Payload | Transports OrderEvent instances directly (no pooling). |
| Mode | Toggled via FLOX_USE_SYNC_ORDER_BUS macro at compile time. |
| Usage | Used to notify components like PositionManager, PnLTracker, etc. |
Notes¶
SyncPolicyensures deterministic propagation — used in simulation/test environments.AsyncPolicyfavors latency and throughput — suitable for production execution.- Dispatch is resolved via
EventDispatcher<OrderEvent>, which callsdispatchTo(listener).