Reputation: 2098
I am using tokio::join
. Sometimes one of the futures completes with Err
but the other future doesn't complete. I want the combined future to complete as soon as the first future fails, similar to JavaScript's Promise.all
.
Upvotes: 1
Views: 120
Reputation: 2098
As I was writing this question I came across tokio::try-join
, which does exactly what I needed.
Upvotes: 2