Skip to content

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

Open
@jplatte

Description

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.

Activity

Darksonn

Darksonn commented on Dec 15, 2020

@Darksonn
Contributor

This was previously discussed in #2720.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-tokioArea: The main tokio crateC-feature-requestCategory: A feature request.M-runtimeModule: tokio/runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

      Participants

      @Darksonn@jplatte

      Issue actions

        Provide a dedicated way of constructing a runtime that owns exactly one worker thread · Issue #3279 · tokio-rs/tokio