-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
A-tokio-utilArea: The tokio-util crateArea: The tokio-util crateC-proposalCategory: a proposal and request for commentsCategory: a proposal and request for commentsM-taskModule: tokio/taskModule: tokio/task
Description
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
Future
s.
Why did we add the LocalPoolHandle
?
It was added by #3370, the use case is not only for running !Send
Future
s, but also for dispatching !Send
Future
s to other threads.
Why do we need to change the LocalPoolHandle
?
There are two reasons.
- The
LocalSet
is proposed to be deprecated (Proposal: Deprecate Tokio's LocalSet #6741), and we don't want theLocalPoolHandle
keeps relying a deprecated feature. - Almost all downsides of the
LocalSet
can also be applied to theLocalPoolHandle
, see Add a LocalRuntime for replacing Runtime+LocalSet #6739 for the downsides of theLocalSet
. Migrating to theLocalRuntime
can get rid of these downsides.
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
.
Will there be any breaking change?
No, there will not be any breaking change.
Metadata
Metadata
Assignees
Labels
A-tokio-utilArea: The tokio-util crateArea: The tokio-util crateC-proposalCategory: a proposal and request for commentsCategory: a proposal and request for commentsM-taskModule: tokio/taskModule: tokio/task