Trait hotdrink_rs::thread::ThreadPool [−][src]
A trait for thread pool implementations.
Associated Types
type NewError: Debug
[src]
An error for when a new thread pool could not be constructed.
type ExecError: Debug
[src]
An error for when executing a task on the thread pool fails.
Required methods
fn new(
initial: usize,
termination_strategy: TerminationStrategy
) -> Result<Self, Self::NewError> where
Self: Sized,
[src]
initial: usize,
termination_strategy: TerminationStrategy
) -> Result<Self, Self::NewError> where
Self: Sized,
Creates a new thread pool with the specified number of initial workers.
fn execute(
&mut self,
f: impl FnOnce() + Send + 'static
) -> Result<TerminationHandle, Self::ExecError>
[src]
&mut self,
f: impl FnOnce() + Send + 'static
) -> Result<TerminationHandle, Self::ExecError>
Executes some work using the workers in the thread pool.