Table of Contents

Class RaceOperator

Namespace
RxSharp.Operators
Assembly
RxSharp.dll

Extension methods implementing the raceWith operator.

public static class RaceOperator
Inheritance
System.Object
RaceOperator

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

source Observable<T>

The source sequence, entered into the race alongside otherSources.

otherSources Observable<T>[]

The other sequences to race against source.

Returns

Observable<T>

An observable that mirrors whichever of source or otherSources emits its first notification first. If otherSources is empty, source itself is returned unchanged.

Type Parameters

T

The type of values shared by source and otherSources.