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§
source§impl<R> PoolHandle<R>
impl<R> PoolHandle<R>
sourcepub fn terminate(self) -> Vec<Result<R>>
pub fn terminate(self) -> Vec<Result<R>>
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.
sourcepub fn finish(self) -> Vec<Result<R>>
pub fn finish(self) -> Vec<Result<R>>
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.