pub struct HealthChecker { /* private fields */ }Expand description
Continuously verifies proxy liveness and updates the shared HealthMap.
Run one check cycle with check_once or launch
a background task with spawn.
Implementations§
Source§impl HealthChecker
impl HealthChecker
Sourcepub fn health_map(&self) -> &HealthMap
pub fn health_map(&self) -> &HealthMap
Access the shared health map (read it to filter candidates).
Sourcepub fn new(
config: ProxyConfig,
storage: Arc<dyn ProxyStoragePort>,
health_map: HealthMap,
) -> Self
pub fn new( config: ProxyConfig, storage: Arc<dyn ProxyStoragePort>, health_map: HealthMap, ) -> Self
Create a new checker.
health_map should be the same Arc held by the ProxyManager so
that selection decisions always see up-to-date health information.
Sourcepub fn spawn(self, token: CancellationToken) -> JoinHandle<()>
pub fn spawn(self, token: CancellationToken) -> JoinHandle<()>
Spawn an infinite background task that checks proxies on every
config.health_check_interval tick.
Cancel token to stop the task gracefully. Missed ticks are skipped.
Sourcepub async fn check_once(&self)
pub async fn check_once(&self)
Run one full check cycle synchronously (useful for tests).
Trait Implementations§
Source§impl Clone for HealthChecker
impl Clone for HealthChecker
Source§fn clone(&self) -> HealthChecker
fn clone(&self) -> HealthChecker
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HealthChecker
impl !RefUnwindSafe for HealthChecker
impl Send for HealthChecker
impl Sync for HealthChecker
impl Unpin for HealthChecker
impl UnsafeUnpin for HealthChecker
impl !UnwindSafe for HealthChecker
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