pub struct DynamicRouteProvider { /* private fields */ }Expand description
A RouteProvider that will attempt to discover new boundary nodes and cycle through them, optionally prioritizing those with low latency.
Implementations§
Source§impl DynamicRouteProvider
impl DynamicRouteProvider
Sourcepub async fn run_in_background(
seed_domains: Vec<String>,
client: Arc<dyn HttpService>,
strategy: DynamicRoutingStrategy,
) -> Result<Self, AgentError>
pub async fn run_in_background( seed_domains: Vec<String>, client: Arc<dyn HttpService>, strategy: DynamicRoutingStrategy, ) -> Result<Self, AgentError>
Create a new DynamicRouter from a list of seed domains and a routing strategy.
Sourcepub async fn run_in_background_with_intervals(
seed_domains: Vec<String>,
client: Arc<dyn HttpService>,
strategy: DynamicRoutingStrategy,
list_update_interval: Duration,
health_check_interval: Duration,
) -> Result<Self, AgentError>
pub async fn run_in_background_with_intervals( seed_domains: Vec<String>, client: Arc<dyn HttpService>, strategy: DynamicRoutingStrategy, list_update_interval: Duration, health_check_interval: Duration, ) -> Result<Self, AgentError>
Same as run_in_background, but with custom intervals for refreshing the routing list and health-checking nodes.
Trait Implementations§
Source§impl Debug for DynamicRouteProvider
impl Debug for DynamicRouteProvider
Source§impl RouteProvider for DynamicRouteProvider
impl RouteProvider for DynamicRouteProvider
Source§fn route(&self) -> Result<Url, AgentError>
fn route(&self) -> Result<Url, AgentError>
Generates the next routing URL based on the internal routing logic. Read more
Source§fn n_ordered_routes(&self, n: usize) -> Result<Vec<Url>, AgentError>
fn n_ordered_routes(&self, n: usize) -> Result<Vec<Url>, AgentError>
Generates up to
n different routing URLs in order of priority. Read moreSource§fn routes_stats(&self) -> RoutesStats
fn routes_stats(&self) -> RoutesStats
Returns statistics about the total number of existing routes and the number of healthy routes.
Auto Trait Implementations§
impl Freeze for DynamicRouteProvider
impl !RefUnwindSafe for DynamicRouteProvider
impl Send for DynamicRouteProvider
impl Sync for DynamicRouteProvider
impl Unpin for DynamicRouteProvider
impl !UnwindSafe for DynamicRouteProvider
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