Skip to main content

Observer

Trait Observer 

Source
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§

Source

fn rotation(&self, stack: &str, service: &str, ips: &[IpAddr])

The in-rotation replicas of a service changed. stack is qualified.

Source

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.

Source

fn stacks_changed(&self, defs: Vec<Arc<StackDef>>)

The deployed definitions changed (deploy, scale, rollback, removal).

Source

fn domains(&self, stack: &str, service: &str) -> Vec<DomainStatus>

A service’s domains for its status.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§