Skip to content

RFC: Replace the internal implementation of LocalPoolHandle with LocalRuntime #7560

@ADD-SP

Description

@ADD-SP

This issue is tracked by #7558, and it can be done after stabilizing the LocalRuntime.

What is the LocalPoolHandle?

It manages several Current Thread Runtimes and uses LocalSet to execute !Send Futures.

Why did we add the LocalPoolHandle?

It was added by #3370, the use case is not only for running !Send Futures, but also for dispatching !Send Futures to other threads.

Why do we need to change the LocalPoolHandle?

There are two reasons.

What should we do?

I have read the implementation of the LocalPoolHandle and I think it is not hard to replace the internal Current Thread Runtime by the LocalRuntime.

https://github.com/tokio-rs/tokio/blob/925c614c89d0a26777a334612e2ed6ad0e7935c3/tokio-util/src/task/spawn_pinned.rs

Will there be any breaking change?

No, there will not be any breaking change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tokio-utilArea: The tokio-util crateC-proposalCategory: a proposal and request for commentsM-taskModule: tokio/task

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions