Skip to main content

race_stream

Function race_stream 

Source
pub fn race_stream<'a, SVC, SVCS, F, Fut, S, T, E>(
    services: SVCS,
    f: F,
) -> impl Stream<Item = Result<T, Error<E>>> + 'a
where F: FnMut(SVC) -> Fut + Copy + 'a, Fut: Future<Output = Option<S>> + 'a, SVCS: IntoIterator<Item = SVC> + 'a, SVC: 'a, S: Stream<Item = Result<T, E>>, E: Send + 'a, T: Send + 'a,
Expand description

Runs an operation returning a stream on all services.

The passed async function describes the operation to run on each service.

The returned Option<_> controls whether to ignore a response, such as an error, or an empty stream (and continue with other backends) or return it.