-
When the http server receives a request, it will generate a If I want to call several services concurrently, what should I do? Is there some method to spawn a task with the same task_local? |
Beta Was this translation helpful? Give feedback.
Answered by
Darksonn
Dec 13, 2021
Replies: 1 comment 4 replies
-
You would need to set the task local in the child task as well. Alternatively, you can use combinators such as |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
lz1998
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You would need to set the task local in the child task as well. Alternatively, you can use combinators such as
tokio::join!
,FuturesUnordered
orStreamExt::buffer_unordered
which don't actually spawn independent tasks, so task locals remain active inside them.