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.
When the tls-profiled feature is enabled you can supply a
ProfiledRequester via
[HealthChecker::with_profiled_client] so health-check GET requests carry a
browser TLS fingerprint.
Implementations§
Source§impl HealthChecker
impl HealthChecker
Sourcepub const fn health_map(&self) -> &HealthMap
pub const 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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more