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 the documentation of FuturesUnordered it's written
"When new futures are added, poll_next must be called in order to begin receiving wake-ups for new futures."
Does it mean that if I consume the FuturesUnordered as a Stream and there is no more futures inside it, it would return None but if then later I add a future, it will return Some again?
In the current implementation, this seems to be the case:
I wondered the same and would appreciate to have this documented if it is indeed something that is guaranteed to be the case going forward to avoid unexpected breakage.
if I consume the FuturesUnordered as a Stream and there is no more futures inside it, it would return None but if then later I add a future, it will return Some again?
Is it a behavior I can rely upon? In other words, is this guarantee by FuturesUnordered ?
Yes. This is a guaranteed behavior. (Relevant test is here.)
I would accept a PR to expand documentation to clarify the guarantee here.
In the documentation of
FuturesUnordered
it's writtenDoes it mean that if I consume the
FuturesUnordered
as aStream
and there is no more futures inside it, it would returnNone
but if then later I add a future, it will returnSome
again?In the current implementation, this seems to be the case:
PlayGround Link
Is it a behavior I can rely upon? In other words, is this guarantee by
FuturesUnordered
?The text was updated successfully, but these errors were encountered: