Table of Contents

Class ExhaustMapOperator

Namespace
RxSharp.Operators
Assembly
RxSharp.dll

Extension methods implementing the exhaustMap operator.

public static class ExhaustMapOperator
Inheritance
System.Object
ExhaustMapOperator

Methods

ExhaustMap<TSource, TResult>(Observable<TSource>, Func<TSource, Observable<TResult>>)

Projects each value from source to an inner observable via project, but only while no previously projected inner observable is still active: while one is active, new source values are silently ignored (not queued) rather than merged or switched to. Once the active inner observable completes, the next source value is free to start a new one. The output completes once source has completed and the current inner observable, if any, has also completed.

public static Observable<TResult> ExhaustMap<TSource, TResult>(this Observable<TSource> source, Func<TSource, Observable<TResult>> project)

Parameters

source Observable<TSource>

The source sequence.

project Func<TSource, Observable<TResult>>

A function that maps each accepted source value to the inner observable to subscribe to.

Returns

Observable<TResult>

An observable that emits the values of each accepted inner observable, ignoring source values that arrive while one is still active.

Type Parameters

TSource

The type of values emitted by source.

TResult

The type of values emitted by the inner observables produced by project.

Remarks

If project throws, the exception is forwarded to the subscriber via OnError instead of propagating synchronously. An error from source or from the active inner observable also terminates the output immediately via OnError. The index passed to project only advances for values that are actually accepted (i.e. not ignored while an inner observable is active).

ExhaustMap<TSource, TResult>(Observable<TSource>, Func<TSource, int, Observable<TResult>>)

Projects each value from source, along with its zero-based acceptance index, to an inner observable via project, but only while no previously projected inner observable is still active: while one is active, new source values are silently ignored (not queued) rather than merged or switched to. Once the active inner observable completes, the next source value is free to start a new one. The output completes once source has completed and the current inner observable, if any, has also completed.

public static Observable<TResult> ExhaustMap<TSource, TResult>(this Observable<TSource> source, Func<TSource, int, Observable<TResult>> project)

Parameters

source Observable<TSource>

The source sequence.

project Func<TSource, int, Observable<TResult>>

A function that maps each accepted source value and its acceptance index (starting at 0) to the inner observable to subscribe to.

Returns

Observable<TResult>

An observable that emits the values of each accepted inner observable, ignoring source values that arrive while one is still active.

Type Parameters

TSource

The type of values emitted by source.

TResult

The type of values emitted by the inner observables produced by project.

Remarks

If project throws, the exception is forwarded to the subscriber via OnError instead of propagating synchronously. An error from source or from the active inner observable also terminates the output immediately via OnError. The index only advances for values that are actually accepted (i.e. not ignored while an inner observable is active) — so it is not the same as the emission index of source itself.