I have two TryStream values that I want to pipe into two sinks for as long as there aren't any errors. In parallel, but as soon as either of them fails, the other should stop too. How do I do that?
This should be robust to panicking: if it is indeed two tasks, a panic in one task should stop the other. This means having a shared flag is not an option.
#Run two async tasks in parallel, abort when either finishes
6 messages · Page 1 of 1 (latest)
Merge the two streams (tokio-stream’s merge or futures-util’s select)
then iterate over them fallibly