Skip to main content

WorkerPool

Trait WorkerPool 

Source
pub trait WorkerPool: Send + Sync {
    // Required methods
    fn submit(&self, task: WorkerTask);
    fn wait_idle(&self);
    fn thread_count(&self) -> usize;
}
Expand description

A thread pool the library submits work to.

Required Methods§

Source

fn submit(&self, task: WorkerTask)

Run task — now, or on a worker thread.

Source

fn wait_idle(&self)

Block until every submitted task has finished.

Source

fn thread_count(&self) -> usize

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§