Skip to main content

fanout_with

Function fanout_with 

Source
pub fn fanout_with<S, I, T, F, Fut>(
    pairs: S,
    send: F,
    opts: Opts,
) -> impl Stream<Item = Outcome<T>> + Send
where S: Stream<Item = (OwnedServerName, I)> + Send, F: Fn(OwnedServerName, I) -> Fut + Send, Fut: Future<Output = Result<T>> + Send, I: Send, T: Send,
Expand description

Drives destination and payload pairs through a supplied asynchronous send.

Results are yielded in completion order. Every consumed pair produces one outcome unless the caller drops the stream and cancels the remaining work.