pub trait WorkHooks:
Send
+ Sync
+ 'static {
// Provided methods
fn may_reserve(&self) -> bool { ... }
fn attempted(&self, attempt: &Attempt) { ... }
}Expand description
What a supervisor (navree-fleet’s workers) puts around a worker: asked before every reservation, told after every attempt. Both run on the worker’s task, so keep them quick.
Provided Methods§
Sourcefn may_reserve(&self) -> bool
fn may_reserve(&self) -> bool
Whether the worker may take a job now. false holds it (a paused
supervisor): it takes nothing and asks again after a poll interval
(a worker that stops when empty stops instead). Default: true.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".