[−][src]Trait workpool::Pool
Pool allows for parallel processing of items. When creating a pool a Worker
and Reducer
are provided. The worker accepts input and produces one output
value for every input value. The reducer reduces the output from the worker
into a single resulting value. Once created you can add input values to the
pool using add()
. Once all input has been added you can invoke either
wait()
or wait_handle()
to wait for all input to be processed and
retrieve the reduced output value.
Associated Types
type Output
type WaitHandle: WaitHandle<Output = Self::Output>
Required methods
Loading content...Implementors
impl<I, W, R> Pool<I> for DynamicPool<I, W, R> where
W: Worker<I>,
R: Reducer<W::Output>,
[src]
W: Worker<I>,
R: Reducer<W::Output>,
type Output = R::Output
type WaitHandle = WaitHandle<R::Output>
fn add(&self, input: I)
[src]
fn wait_handle(self) -> Self::WaitHandle
[src]
fn wait(self) -> R::Output
[src]
impl<I, W, R> Pool<I> for StaticPool<I, W, R> where
I: Send + 'static,
W: Worker<I> + Send + Sync + 'static,
R: Reducer<W::Output> + Send + 'static,
R::Output: Send + Sync,
[src]
I: Send + 'static,
W: Worker<I> + Send + Sync + 'static,
R: Reducer<W::Output> + Send + 'static,
R::Output: Send + Sync,