Expand description
futures-cputask allows you to turn long-running CPU tasks into a async function that runs on a secondary threadpool.
While futures-preview allows execution of tasks, it runs it on the main threadpool, which clogs up one of the threads while the future is run. Running it on a secondary threadpool allows for potentially higher throughput.
This crate supports multiple threadpool implementations, namely the one found in threadpool and the one found in uvth.
You can add support for other threadpool implementations by using the SyncThreadPool trait found
in this crate
Structs§
- GLOBAL_
THREADPOOL - Global threadpool
- Thread
Pool - Asynchronous threadpool
Traits§
- Async
Thread Pool - Asynchronous threadpools
- Sync
Thread Pool - ThreadPool trait
Functions§
- run_
task - Runs a task in the global threadpool
- run_
task_ in_ pool - Runs a task in an asynchronous threadpool
Attribute Macros§
- async_
task - Makes a synchronous function asynchronous using futures-cputask