Struct tokio::runtime::Builder [] [src]

pub struct Builder { /* fields omitted */ }

Builds Tokio Runtime with custom configuration values.

Methods can be chained in order to set the configuration values. The Runtime is constructed by calling build.

New instances of Builder are obtained via Builder::new.

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

Examples


// create and configure ThreadPool
let mut threadpool_builder = tokio_threadpool::Builder::new();
threadpool_builder
    .name_prefix("my-runtime-worker-")
    .pool_size(4);

// build Runtime
let runtime = Builder::new()
    .threadpool_builder(threadpool_builder)
    .build();
// ... call runtime.run(...)

Methods

impl Builder
[src]

[src]

Returns a new runtime builder initialized with default configuration values.

Configuration methods can be chained on the return value.

Important traits for &'a mut R
[src]

Set the Clock instance that will be used by the runtime.

Important traits for &'a mut R
[src]

Set builder to set up the thread pool instance.

[src]

Create the configured Runtime.

The returned ThreadPool instance is ready to spawn tasks.

Examples

let runtime = Builder::new().build().unwrap();
// ... call runtime.run(...)

Trait Implementations

impl Debug for Builder
[src]

[src]

Formats the value using the given formatter. Read more