Skip to content

Non-Send version of callbacks such as on_thread_park #7370

Open
@Darksonn

Description

@Darksonn

When using LocalRuntime, it's possible to guarantee that certain callbacks on the runtime builder only run on the current thread. So we should provide non-Send versions of those callbacks.

Note that we should have tests for this. For example, it's very important that on_thread_park only runs inside Runtime::block_on calls. If it also runs in Handle::block_on calls, then this logic does not work. There must be tests for that before non-Send versions of the callbacks can be accepted.

Metadata

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

    Issue actions