Skip to main content

BayesianObserver

Trait BayesianObserver 

Source
pub trait BayesianObserver:
    Send
    + Sync
    + 'static {
    // Required method
    fn observe(&self, proxy_id: Uuid, success: bool);
}
Expand description

Callback that receives outcome observations for a specific proxy.

ProxyManager calls observe(success = true) on ProxyHandle::mark_success and observe(success = false) on drop without mark_success. The default implementation is NoopBayesianObserver, which discards observations; the bayesian-rotation feature wires [ThompsonStrategy] in via [crate::manager::ProxyManagerBuilder::with_thompson_sampling].

Required Methods§

Source

fn observe(&self, proxy_id: Uuid, success: bool)

Record one outcome for proxy_id. Implementations must be safe to call from any thread and must never block on locks the hot path already holds.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§