pub trait Observer: Send + Sync {
// Required methods
fn rotation(&self, stack: &str, service: &str, ips: &[IpAddr]);
fn drain(&self, stack: &str, service: &str, ip: IpAddr, timeout: Duration);
fn stacks_changed(&self, defs: Vec<Arc<StackDef>>);
fn domains(&self, stack: &str, service: &str) -> Vec<DomainStatus>;
}Expand description
Something that follows which replicas receive traffic: the ingress. Called from worker threads, never with a controller lock held.
Required Methods§
Sourcefn rotation(&self, stack: &str, service: &str, ips: &[IpAddr])
fn rotation(&self, stack: &str, service: &str, ips: &[IpAddr])
The in-rotation replicas of a service changed. stack is qualified.
Sourcefn drain(&self, stack: &str, service: &str, ip: IpAddr, timeout: Duration)
fn drain(&self, stack: &str, service: &str, ip: IpAddr, timeout: Duration)
Wait (at most timeout) until requests to ip have drained from the
observer’s proxies, before the replica is stopped.
Sourcefn stacks_changed(&self, defs: Vec<Arc<StackDef>>)
fn stacks_changed(&self, defs: Vec<Arc<StackDef>>)
The deployed definitions changed (deploy, scale, rollback, removal).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".