I/O thread pool

Because of AIO on Linux sucks, I want to do some blocking calls.
I find out tokio_threadpool::blocking - Rust

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.


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.