You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm using tokio's unstable API, mainly for tracing, and have started using tokio::task::Builder to name my long-running tasks. I now also have a use case for tokio_util::task::JoinMap, and find it unfortunate that the two do not compose. For my particular case, I'd just like to give names to the tasks in my JoinMap, but this can be generalized to other use cases as well, such as spawning a task manually in one place, and then inserting it into a JoinMap later (or conditionally).
Describe the solution you'd like
What I think would be a reasonable addition to JoinMap's public API is an explicit insert() method that takes a key and a JoinHandle.
Describe alternatives you've considered
leaving the API as-is, because this may not be an important feature to many people
adding more spawn_* methods that take a task::Builder or return their own builder type
this does not seem like a very good solution, as it adds way more code and is less general than what I propose, but it would fix my specific issue just as well
Additional context JoinMap already has a private insert method that is called by spawn and friends, so the change may be as simple as making that method pub (and potentially changing the parameter type from AbortHandle to JoinHandle? unclear if that's necessary or desired).
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I'm using tokio's unstable API, mainly for tracing, and have started using
tokio::task::Builder
to name my long-running tasks. I now also have a use case fortokio_util::task::JoinMap
, and find it unfortunate that the two do not compose. For my particular case, I'd just like to give names to the tasks in myJoinMap
, but this can be generalized to other use cases as well, such as spawning a task manually in one place, and then inserting it into aJoinMap
later (or conditionally).Describe the solution you'd like
What I think would be a reasonable addition to
JoinMap
's public API is an explicitinsert()
method that takes a key and aJoinHandle
.Describe alternatives you've considered
spawn_*
methods that take atask::Builder
or return their own builder typeAdditional context
JoinMap
already has a privateinsert
method that is called byspawn
and friends, so the change may be as simple as making that methodpub
(and potentially changing the parameter type fromAbortHandle
toJoinHandle
? unclear if that's necessary or desired).The text was updated successfully, but these errors were encountered: