Struct tokio_io_pool::Builder[][src]

pub struct Builder { /* fields omitted */ }

Builds an I/O-oriented thread pool (Runtime) with custom configuration values.

Methods can be chained in order to set the configuration values. The thread pool is constructed by calling Builder::build. New instances of Builder are obtained via [Builder::default].

See function level documentation for details on the various configuration settings.

Methods

impl Builder
[src]

Set the number of worker threads for the thread pool instance.

This must be a number between 1 and 32,768 though it is advised to keep this value on the smaller side.

The default value is the number of cores available to the system.

Set name prefix of threads spawned by the scheduler

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.

If this configuration is not set, then the thread will use the system default naming scheme.

Execute function f after each thread is started but before it starts doing work.

This is intended for bookkeeping and monitoring use cases.

Execute function f before each thread stops.

This is intended for bookkeeping and monitoring use cases.

Create the configured Runtime.

The returned Runtime instance is ready to spawn tasks.

Trait Implementations

impl Debug for Builder
[src]

Formats the value using the given formatter. Read more

impl Default for Builder
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl Send for Builder

impl Sync for Builder