I/O thread pool


Because of AIO on Linux sucks, I want to do some blocking calls.
I find out https://docs.rs/tokio-threadpool/0.1/tokio_threadpool/fn.blocking.html

Thread pool in tokio aware about blocking problems, and have special threads for that,
and special function to run blocking task. Because of I already use tokio I decide that this is good t hing for me.

But I’m lost in tokio documentation. I can not see the way to get ThreadPool from Runtime.

There is reference inside runtime documentation about ThreadPool


but no point about how to get access to ThreadPool::blocking functionality.

And if I can create and use thread pool directly to run futures, why Runtime exists?



You don’t need to have access to the ThreadPool. blocking is a free function, not a method on that type.