Skip to main content

ClassifiedWorker

Trait ClassifiedWorker 

Source
pub trait ClassifiedWorker<C: WorkerClassification>: Send + 'static {
    // Required methods
    fn is_work(&self) -> bool;
    fn is_valid(&self, c: C) -> bool;
    fn classification(&self) -> C;
}

Required Methods§

Source

fn is_work(&self) -> bool

Source

fn is_valid(&self, c: C) -> bool

Returns whether this worker can currently serve the requested classification. The pool still tracks capacity by the worker’s primary classification().

Source

fn classification(&self) -> C

Returns the worker’s primary classification used for accounting and replacement.

Implementors§