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
In particular, the futures version requires futures to implement the FusedFuture trait and accesses them by mutable reference while the tokio variant moves futures (so users may instead pass &mut f) and does not require fusing.
We should at least mention the existence of the non-Tokio version so things don't seem so magical.
The text was updated successfully, but these errors were encountered:
This is a good point! And perhaps the higher-level takeaway is that async Rust, while usable in production, is still in the "few ways to do it, seeing what's best" phase, and further stabilization will eventually select one preferred way to do it.
Currently when talking about combining futures, we introduce the
futures::join
macro andfutures::join_all
function, thentokio::select
. But there is also aselect
macro in the futures library itself, though it has slightly different semantics and requirements: https://stackoverflow.com/questions/60811657/what-is-the-difference-between-futuresselect-and-tokioselectIn particular, the
futures
version requires futures to implement theFusedFuture
trait and accesses them by mutable reference while thetokio
variant moves futures (so users may instead pass&mut f
) and does not require fusing.We should at least mention the existence of the non-Tokio version so things don't seem so magical.
The text was updated successfully, but these errors were encountered: