Module blocking

Source
Expand description

Blocking tasks related.

Structs§

BlockingTask
BlockingTask is contrusted by monoio, ThreadPool impl will execute it with .run().
DefaultThreadPool
DefaultThreadPool is a simple wrapped threadpool::ThreadPool that implement monoio::blocking::ThreadPool. You may use this implementation, or you can use your own thread pool implementation.

Enums§

BlockingStrategy
BlockingStrategy can be set if there is no ThreadPool attached. It controls how to handle spawn_blocking without thread pool.
JoinError
Error on waiting blocking task.

Traits§

ThreadPool
Users may implement a ThreadPool and attach it to runtime. We also provide an implementation based on threadpool crate, you can use DefaultThreadPool.

Functions§

spawn_blocking
spawn_blocking is used for executing a task(without async) with heavy computation or blocking io.