DynamicRouteProvider

Struct DynamicRouteProvider 

Source
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

Source

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.

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl RouteProvider for DynamicRouteProvider

Source§

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>

Generates up to n different routing URLs in order of priority. Read more
Source§

fn routes_stats(&self) -> RoutesStats

Returns statistics about the total number of existing routes and the number of healthy routes.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T