Struct conch_runtime::env::ThreadPoolAsyncIoEnv [] [src]

pub struct ThreadPoolAsyncIoEnv { /* fields omitted */ }

An AsyncIoEnvironment implementation that uses a threadpool for doing reads and writes on synchronous/blocking FileDesc handles.

This is a pretty costly implementation which may be required on systems that do not support asynchronous read/write operations (easily or at all). If running on a system that supports more efficient async operations, it is strongly encouraged to use an alternative implementation.

Note: Caller should ensure that any FileDesc handles passed into this environment are not configured for asynchronous operations, otherwise operations will fail with a WouldBlock error. This is done to avoid burning CPU cycles while spinning on read/write operations.

Methods

impl ThreadPoolAsyncIoEnv
[src]

[src]

Creates a new thread pool with size worker threads associated with it.

[src]

Creates a new thread pool with a number of workers equal to the number of CPUs on the host.

Trait Implementations

impl Clone for ThreadPoolAsyncIoEnv
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl SubEnvironment for ThreadPoolAsyncIoEnv
[src]

[src]

Create a new sub-environment, which starts out idential to its parent, but any changes on the new environment will not be reflected on the parent. Read more

impl Debug for ThreadPoolAsyncIoEnv
[src]

[src]

Formats the value using the given formatter.

impl AsyncIoEnvironment for ThreadPoolAsyncIoEnv
[src]

An async/futures-aware Read adapter around a FileDesc.

An future that represents writing data into a FileDesc.

[src]

Creates a futures-aware adapter to read data from a FileDesc asynchronously.

[src]

Creates a future for writing data into a FileDesc.

[src]

Asynchronously write the contents of data to a FileDesc in the background on a best effort basis (e.g. the implementation can give up due to any (appropriately) unforceen errors like broken pipes). Read more