pub struct LockFreeExchangeManager { /* private fields */ }Expand description
Lock-free exchange manager optimized for high-frequency operations
Implementations§
Source§impl LockFreeExchangeManager
impl LockFreeExchangeManager
Sourcepub async fn add_exchange(
&self,
exchange_name: SmartString,
client: ExchangeClient,
) -> Result<()>
pub async fn add_exchange( &self, exchange_name: SmartString, client: ExchangeClient, ) -> Result<()>
Add an exchange to the manager (infrequent operation, uses lock)
Sourcepub async fn remove_exchange(&self, exchange_name: &str) -> Result<()>
pub async fn remove_exchange(&self, exchange_name: &str) -> Result<()>
Remove an exchange from the manager (infrequent operation)
Sourcepub async fn start_collection(
&self,
exchange_name: &str,
symbols: Vec<SmartString>,
data_types: Vec<DataType>,
event_sender: Sender<MarketDataEvent>,
) -> Result<()>
pub async fn start_collection( &self, exchange_name: &str, symbols: Vec<SmartString>, data_types: Vec<DataType>, event_sender: Sender<MarketDataEvent>, ) -> Result<()>
Start collection for an exchange (mostly lock-free)
Sourcepub fn record_message(&self, exchange_name: &str, bytes: u64)
pub fn record_message(&self, exchange_name: &str, bytes: u64)
Record a message for an exchange (lock-free)
Sourcepub fn record_error(&self, exchange_name: &str)
pub fn record_error(&self, exchange_name: &str)
Record an error for an exchange (lock-free)
Sourcepub fn get_connection_status(&self) -> FxHashMap<SmartString, bool>
pub fn get_connection_status(&self) -> FxHashMap<SmartString, bool>
Get connection status for all exchanges (mostly lock-free reads)
Sourcepub async fn health_check(&self) -> FxHashMap<SmartString, bool>
pub async fn health_check(&self) -> FxHashMap<SmartString, bool>
Perform health check on all exchanges (lock-free coordination)
Sourcepub fn get_statistics(&self) -> ExchangeManagerStats
pub fn get_statistics(&self) -> ExchangeManagerStats
Get comprehensive statistics (mostly lock-free reads)
Sourcepub fn request_shutdown(&self)
pub fn request_shutdown(&self)
Request shutdown (lock-free)
Sourcepub fn is_shutdown_requested(&self) -> bool
pub fn is_shutdown_requested(&self) -> bool
Check if shutdown was requested (lock-free)
Trait Implementations§
Source§impl Default for LockFreeExchangeManager
impl Default for LockFreeExchangeManager
impl Send for LockFreeExchangeManager
impl Sync for LockFreeExchangeManager
Auto Trait Implementations§
impl !Freeze for LockFreeExchangeManager
impl !RefUnwindSafe for LockFreeExchangeManager
impl Unpin for LockFreeExchangeManager
impl !UnwindSafe for LockFreeExchangeManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more