Enum dynpool::Scale

source ·
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

Fields

active: usize

Number of active workers.

max_inactive: usize

Maximum number of inactive worker.

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

Shutdown the pool.

Scale to exactly the given number of workers.

Scale to the given number of active workers and no more than the given number of inactive workers.

Scale to the given number of active workers without shutting down any inactive workers.

How many active workers should the pool scale to?

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.