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§
Sourcefn then_concurrent<Fut, F, L>(
self,
f: F,
limit: L,
) -> ThenConcurrent<Self, Fut, F>
fn then_concurrent<Fut, F, L>( self, f: F, limit: L, ) -> ThenConcurrent<Self, Fut, F>
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.