Struct mio_pool::PoolHandle

source ·
pub struct PoolHandle<R> { /* private fields */ }
Expand description

A handle to a currently executing mio pool.

This handle can be used to terminate the running pool, and to wait for its completion. See PoolHandle::terminate and PoolHandle::wait for details.

Implementations§

Tell all running workers to terminate, and then wait for their completion.

Note that this will not wait for existing connections to terminate, but termination may be delayed until the next time each worker is idle.

Stop accepting connections and wait for existing connections to complete.

This method will tell worker threads not to accept new connetions, and to exit once all current connections have been closed.

Note that this method will not immediately drop the Listener, so new clients that try to connect will hang (i.e., not get a connection refused) until the workers have all exited.

Wait for all running workers to terminate.

This method will not tell worker threads to exit, and so will only return once when all worker threads have crashed (which should not happen in general). Users may instead want to use PoolHandle::terminate.

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 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.