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§
- error 🔒
Structs§
- The thread pool.
- The thread pool builder.
- The thread pool task resolver.
- The thread pool task resolver shared state.
Enums§
- The global
Errorenum of the module.
Traits§
- The thread pool context builder.
Type Aliases§
- The global
Resultalias of the module. - The thread pool task.