What's the correct way of limiting the Tokio (v 0.1.11) threadpool to n
OS native threads, where n
is an arbitrary number, preferably configurable at runtime?
As far as I can tell, it's possible to use Tokio in single threaded mode using using tokio_current_thread::block_on_all
instead of tokio::run
and tokio_current_thread::spawn
instead of tokio::spawn
.
I'd like a similar solution but for n >= 1
.