Maybe future::race should return a struct `Race` that will resolve the first future, but also provides a way to extract the unresolved future. This would mean not using an async fn which I think we probably shouldn't be doing overall. https://docs.rs/async-std/1.5.0/async_std/future/trait.Future.html#method.race …
-
-
-
Replying to @withoutboats
Exactly; but without the difficulties that macros bring. Would mostly be a small extension to the existing code to allow retrieving the other Future after polling is done: https://github.com/async-rs/async-std/blob/master/src/future/future/race.rs … Though it may very well not be worth it.
1 reply 0 retweets 0 likes -
Replying to @yoshuawuyts
It would require that the futures implement Unpin, like select does, because it would move them after polling.
1 reply 0 retweets 2 likes
Replying to @withoutboats
*ah* -- yeah no let's not
7:34 AM - 21 Apr 2020
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.