Module email::thread_pool

source ·
Expand description

§Thread pool

Module dedicated to thread pool management. The ThreadPool is the main structure of this module: it basically spawns n threads and transfers tasks to them using an unbounded channel. The receiver part is shared accross all threads in a mutex, this way only one thread can wait for a task at a time. When a thread receives a task, it releases the lock and an other thread can wait for the next task. A task is a function that takes a ThreadPoolContextBuilder::Context and returns a future. The easiest way to build a pool is to use the ThreadPoolBuilder.

Modules§

Structs§

Enums§

  • The global Error enum of the module.

Traits§

Type Aliases§