Skip to main content

select_either

Function select_either 

Source
pub async fn select_either<'a, F1, F2>(
    future1: F1,
    future2: F2,
) -> Either<F1::Output, F2::Output>
where F1: Future + 'a, F2: Future + 'a,
Expand description

Waits for either of two futures to complete.

This function polls both futures concurrently and returns the result of the first one that finishes. The future that did not complete is dropped.