Class RaceOperator
Extension methods implementing the raceWith operator.
public static class RaceOperator
- Inheritance
-
System.ObjectRaceOperator
Methods
RaceWith<T>(Observable<T>, params Observable<T>[])
Subscribes to source and every observable in otherSources at the
same time. Whichever one produces the first notification of any kind (a value, an error, or completion)
"wins" the race: the output mirrors that observable from then on, and every other, losing subscription
is unsubscribed immediately, so a losing source can never emit or run further side effects afterward.
public static Observable<T> RaceWith<T>(this Observable<T> source, params Observable<T>[] otherSources)
Parameters
sourceObservable<T>The source sequence, entered into the race alongside
otherSources.otherSourcesObservable<T>[]The other sequences to race against
source.
Returns
- Observable<T>
An observable that mirrors whichever of
sourceorotherSourcesemits its first notification first. IfotherSourcesis empty,sourceitself is returned unchanged.
Type Parameters
TThe type of values shared by
sourceandotherSources.