Skip to content

,System.Func,System.IObservable{--1}})}

Observable.RepeatWhen(IObservable, Func, IObservable>) method

Defined in

Type: Observable Namespace: System.Reactive.Linq Assembly: System.Reactive.dll

Applies to

netstandard2.0

public static IObservable<TSource> RepeatWhen<TSource, TSignal>(this IObservable<TSource> source, Func<IObservable<object>, IObservable<TSignal>> handler)

Summary: Repeatedly resubscribes to the source observable after a normal completion and when the observable returned by a handler produces an arbitrary item.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.
TSignalThe arbitrary element type signaled by the handler observable.

Parameters

NameTypeDescription
sourceIObservableObservable sequence to keep repeating when it successfully terminates.
handlerFunc, IObservable>The function that is called for each observer and takes an observable sequence of objects. It should return an observable of arbitrary items that should signal that arbitrary item in response to receiving the completion signal from the source observable. If this observable signals a terminal event, the sequence is terminated with that signal instead.

Returns: IObservable -- An observable sequence producing the elements of the given sequence repeatedly while each repetition terminates successfully.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.
System.ArgumentNullExceptionhandler is null.