Struct thread_pool::Builder [] [src]

pub struct Builder { /* fields omitted */ }

Thread pool configuration.

Provide detailed control over the properties and behavior of the thread pool.

Methods

impl Builder
[src]

Returns a builder with default values

Set the thread pool's core size.

The number of threads to keep in the pool, even if they are idle.

Set the thread pool's maximum size

The maximum number of threads to allow in the pool.

Set the thread keep alive duration

When the number of threads is greater than core target or core threads are allowed to timeout, this is the maximum time that idle threads will wait for new tasks before terminating.

Allow core threads to timeout

Maximum number of jobs that can be pending in the work queue

Set name prefix of threads spawned by the pool

Thread name prefix is used for generating thread names. For example, if prefix is my-pool-, then threads in the pool will get names like my-pool-1 etc.

Set the stack size of threads spawned by the pool

Execute function f right after each thread is started but before running any tasks on it

This is initially intended for bookkeeping and monitoring uses

Execute function f before each worker thread stops

This is initially intended for bookkeeping and monitoring uses

Build and return the configured thread pool

Trait Implementations

impl Debug for Builder
[src]

Formats the value using the given formatter.