pub struct BrokerRuntime { /* private fields */ }Implementations§
Source§impl BrokerRuntime
impl BrokerRuntime
pub fn empty() -> Self
pub fn new( backend: SharedBackend, brokers: Arc<DashMap<u32, Arc<BackendConn>>>, broker_conn_meta: Arc<DashMap<u32, BrokerConnMeta>>, ) -> Self
pub fn platform_backend(&self) -> Option<Arc<BackendConn>>
pub fn set_platform_backend(&self, backend: Arc<BackendConn>)
Sourcepub fn overnight_whitelist(&self) -> OvernightWhitelistCache
pub fn overnight_whitelist(&self) -> OvernightWhitelistCache
Shared CMD20874 overnight whitelist cache.
Owner boundary: broker startup/reconnect refreshes this cache; trade
write handlers only read it while computing C++ AdjustTradeSession.
pub fn mark_overnight_whitelist_worker_started(&self, broker_id: u32) -> bool
pub fn platform_connected(&self) -> bool
pub fn clear_platform_backend(&self)
pub fn broker_backend(&self, broker_id: u32) -> Option<Arc<BackendConn>>
pub fn broker_customer_id(&self, broker_id: u32) -> Option<u64>
pub fn broker_meta(&self, broker_id: u32) -> Option<BrokerConnMeta>
pub fn active_broker_ids(&self) -> Vec<u32>
pub fn all_broker_backends(&self) -> Vec<(u32, Arc<BackendConn>)>
Sourcepub fn mark_all_broker_backends_disconnected(
&self,
reason: &'static str,
) -> usize
pub fn mark_all_broker_backends_disconnected( &self, reason: &'static str, ) -> usize
Mark every broker backend disconnected without deleting its meta.
Platform reconnect can invalidate broker-side session semantics while the broker TCP socket still appears open. Failing closed here prevents CMD2900 / trade queries from using a stale broker session; the existing per-broker heartbeat watcher observes the disconnected backend and reconnects with the cached broker auth.
pub fn remove_broker_channel(&self, broker_id: u32)
pub fn remove_broker_backend(&self, broker_id: u32)
pub fn mark_broker_sustain_disconnected( &self, broker_id: u32, reason: &'static str, )
pub fn update_broker_auth( &self, broker_id: u32, broker_auth: BrokerAuth, ) -> bool
pub fn register_broker_channel( &self, broker_id: u32, conn: Arc<BackendConn>, meta: BrokerConnMeta, )
pub fn set_broker_meta(&self, broker_id: u32, meta: BrokerConnMeta)
pub fn set_broker_backend(&self, broker_id: u32, conn: Arc<BackendConn>)
pub fn mark_broker_reconnecting(&self, broker_id: u32, max_failures: u32)
pub fn mark_broker_reconnect_attempt(&self, broker_id: u32, max_failures: u32)
pub fn mark_broker_reconnect_failure( &self, broker_id: u32, consecutive_failures: u32, max_failures: u32, )
pub fn mark_broker_reconnect_success(&self, broker_id: u32)
pub fn broker_statuses(&self) -> Vec<BrokerStatus>
Sourcepub fn render_prometheus(&self) -> String
pub fn render_prometheus(&self) -> String
Render per-broker TCP health as Prometheus text exposition.
This intentionally reuses BrokerRuntime::broker_statuses as the
single status source. Metrics labels avoid addr because broker TCP
endpoints are dynamic infrastructure details and high-cardinality.
Trait Implementations§
Source§impl Clone for BrokerRuntime
impl Clone for BrokerRuntime
Source§fn clone(&self) -> BrokerRuntime
fn clone(&self) -> BrokerRuntime
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more