Skip to content

Commit

Permalink
stream: update StreamExt::merge doc (#2520)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darksonn authored May 21, 2020
1 parent 9b81580 commit 7cb5e34
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tokio/src/stream/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,17 @@ pub trait StreamExt: Stream {
/// Values are produced from the merged stream in the order they arrive from
/// the two source streams. If both source streams provide values
/// simultaneously, the merge stream alternates between them. This provides
/// some level of fairness.
/// some level of fairness. You should not chain calls to `merge`, as this
/// will break the fairness of the merging.
///
/// The merged stream completes once **both** source streams complete. When
/// one source stream completes before the other, the merge stream
/// exclusively polls the remaining stream.
///
/// For merging multiple streams, consider using [`StreamMap`] instead.
///
/// [`StreamMap`]: crate::stream::StreamMap
///
/// # Examples
///
/// ```
Expand Down Expand Up @@ -303,7 +308,7 @@ pub trait StreamExt: Stream {
/// As values of this stream are made available, the provided function will
/// be run on them. If the predicate `f` resolves to
/// [`Some(item)`](Some) then the stream will yield the value `item`, but if
/// it resolves to [`None`], then the value value will be skipped.
/// it resolves to [`None`], then the value will be skipped.
///
/// Note that this function consumes the stream passed into it and returns a
/// wrapped version of it, similar to [`Iterator::filter_map`] method in the
Expand Down

0 comments on commit 7cb5e34

Please sign in to comment.