|0.5.2||Feb 2, 2021|
|0.5.1||Jan 29, 2020|
|0.5.0||Nov 27, 2019|
|0.4.1||Dec 4, 2018|
|0.4.0||Jun 1, 2018|
#44 in Asynchronous
5,045 downloads per month
Used in 4 crates
A stream that efficiently multiplexes multiple streams.
This "combinator" provides the ability to maintain and drive a set of streams to completion, while also providing access to each stream as it yields new elements.
Streams are inserted into this set and their realized values are yielded as they are produced.
This structure is optimized to manage a large number of streams. Streams managed by
StreamUnordered will only be polled when they generate notifications. This reduces the
required amount of work needed to coordinate large numbers of streams.
StreamUnordered is first created, it does not contain any streams. Calling
this state will result in
Ok(Async::Ready(None)) to be returned. Streams are submitted to the
insert; however, the stream will not be polled at this point.
will only poll managed streams when
StreamUnordered::poll is called. As such, it is important
poll after inserting new streams.
Ok(Async::Ready(None)) this means that the set is
currently not managing any streams. A stream may be submitted to the set at a later time. At
that point, a call to
StreamUnordered::poll will either return the stream's resolved value
Ok(Async::NotReady) if the stream has not yet completed.
Whenever a value is yielded, the yielding stream's index is also included. A reference to the
stream that originated the value is obtained by using [