Struct AdaptiveRouter
pub struct AdaptiveRouter { /* private fields */ }Expand description
Adaptive routing algorithm that learns from usage patterns
Dynamically adjusts routing strategies based on observed performance and usage patterns to optimize for the current workload.
Implementations§
§impl AdaptiveRouter
impl AdaptiveRouter
pub fn new(base_router: Box<dyn MessageRouter>) -> AdaptiveRouter
pub fn new(base_router: Box<dyn MessageRouter>) -> AdaptiveRouter
Create a new adaptive router
pub fn track_usage(&mut self, topic: &str, latency: Duration)
pub fn track_usage(&mut self, topic: &str, latency: Duration)
Track usage pattern for a topic
pub fn get_optimization_recommendation(
&self,
topic: &str,
) -> OptimizationStrategy
pub fn get_optimization_recommendation( &self, topic: &str, ) -> OptimizationStrategy
Get recommended optimization for a topic
Auto Trait Implementations§
impl !Freeze for AdaptiveRouter
impl !RefUnwindSafe for AdaptiveRouter
impl Send for AdaptiveRouter
impl Sync for AdaptiveRouter
impl Unpin for AdaptiveRouter
impl !UnwindSafe for AdaptiveRouter
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