pub enum Scale {
Shutdown,
Active(usize),
Mixed {
active: usize,
max_inactive: usize,
},
NoTerm {
active: usize,
},
}
Expand description
A goal for the worker pool. This describes the scale that the pool should attempt to reach.
Variants
Shutdown
Shutdown the pool.
Active(usize)
Maintain the given number of active workers. Inactive worker threads are shutdown.
Mixed
Maintain the given number of active workers, and up to the given number of inactive workers. Any extra inactive worker threads are shutdown.
NoTerm
Fields
active: usize
Number of active workers.
Maintain the given number of active workers, and an unlimited number of inactive workers. No worker threads will be terminated unless one panics.
Implementations
sourceimpl Scale
impl Scale
sourcepub fn mixed(active: usize, max_inactive: usize) -> Scale
pub fn mixed(active: usize, max_inactive: usize) -> Scale
Scale to the given number of active workers and no more than the given number of inactive workers.
sourcepub fn no_term(active: usize) -> Scale
pub fn no_term(active: usize) -> Scale
Scale to the given number of active workers without shutting down any inactive workers.
sourcepub fn worker_count(self) -> usize
pub fn worker_count(self) -> usize
How many active workers should the pool scale to?
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Scale
impl Send for Scale
impl Sync for Scale
impl Unpin for Scale
impl UnwindSafe for Scale
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more