Provide a dedicated way of constructing a runtime that owns exactly one worker thread #3279
Labels
A-tokio
Area: The main tokio crate
C-feature-request
Category: A feature request.
M-runtime
Module: tokio/runtime
Is your feature request related to a problem? Please describe.
I was looking to switch from a multithreaded runtime to a single-threaded one, and naively I assumed I could work with what's provided with just the
rt
feature (nort-multi-thread
). After lots of docs reading and a discussion on Discord I now know that this is not correct.Describe the solution you'd like
I would like there to be another constructor for
runtime::Builder
, for a runtime that owns exactly one worker thread. I don't know much about the runtime internals so don't know how this could interact with the existing runtime Cargo features, but even if it would only be available underrt-multi-thread
, it could still help people understand that they should not use thecurrent_thread
runtime if they really want the runtime to conceptually own one worker thread.The text was updated successfully, but these errors were encountered: