Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a dedicated way of constructing a runtime that owns exactly one worker thread #3279

Open
jplatte opened this issue Dec 15, 2020 · 1 comment
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-runtime Module: tokio/runtime

Comments

@jplatte
Copy link
Member

jplatte commented Dec 15, 2020

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 (no rt-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 under rt-multi-thread, it could still help people understand that they should not use the current_thread runtime if they really want the runtime to conceptually own one worker thread.

@jplatte jplatte added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. labels Dec 15, 2020
@Darksonn Darksonn added the M-runtime Module: tokio/runtime label Dec 15, 2020
@Darksonn
Copy link
Contributor

Darksonn commented Dec 15, 2020

This was previously discussed in #2720.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-runtime Module: tokio/runtime
Projects
None yet
Development

No branches or pull requests

2 participants