[−][src]Crate futures_cputask
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 |
ThreadPool | Asynchronous threadpool |
Traits
AsyncThreadPool | Asynchronous threadpools |
SyncThreadPool | 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 |