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
I am an async noob but the 'simple example' in docs on select may be a bad example.
The example selects one of the futures:
let future1 = async{1};let future2 = async{2};
The problem in this is that the computations are both Poll::Ready immediately (at least on my machine).
So the result of the select is always Either::Left, as I would expect from the implementation.
Therefore, the assert! in the example is misleading IMHO.
I would suggest being explicit about one future finishing first.
The simplest example I came up with is here.
The text was updated successfully, but these errors were encountered:
I am an async noob but the 'simple example' in docs on
select
may be a bad example.The example
select
s one of the futures:The problem in this is that the computations are both
Poll::Ready
immediately (at least on my machine).So the result of the
select
is alwaysEither::Left
, as I would expect from the implementation.Therefore, the
assert!
in the example is misleading IMHO.I would suggest being explicit about one future finishing first.
The simplest example I came up with is here.
The text was updated successfully, but these errors were encountered: