Skip to main content

StreamThenConcurrentExt

Trait StreamThenConcurrentExt 

Source
pub trait StreamThenConcurrentExt: Stream {
    // Required method
    fn then_concurrent<Fut, F, L>(
        self,
        f: F,
        limit: L,
    ) -> ThenConcurrent<Self, Fut, F>
       where Self: Sized,
             Fut: Future,
             F: FnMut(Self::Item) -> Fut,
             L: Into<Option<usize>>;
}
Expand description

Extension to futures::stream::Stream

Required Methods§

Source

fn then_concurrent<Fut, F, L>( self, f: F, limit: L, ) -> ThenConcurrent<Self, Fut, F>
where Self: Sized, Fut: Future, F: FnMut(Self::Item) -> Fut, L: Into<Option<usize>>,

Chain a computation when a stream value is ready, passing Ok values to the closure f.

This function is similar to futures::stream::StreamExt::then, but the stream is polled concurrently with the futures returned by f. An unbounded number of futures corresponding to past stream values is kept via FuturesUnordered.

Implementors§