Table of Contents

Class Repeat

Namespace
Bonsai.Reactive
Assembly
Bonsai.Core.dll

Represents an operator that repeats an observable sequence indefinitely.

Marble diagram

Repeat reacts to successful termination by disposing the previous subscription and resubscribing to the source sequence. Elements received from all of the subscriptions are forwarded to the result sequence.

If any of the subscriptions terminates exceptionally, the result sequence will also terminate exceptionally, and no further resubscriptions will be made.

Tip

The subscription side-effects (e.g. opening a file, initializing hardware connections) of all upstream operators will be repeated upon termination and resubscription to the source sequence. Sometimes this may be undesirable. For example logging side-effects introduced by Sink nodes may create extra files on each subscription. To shield operators from these effects, consider moving affected operators downstream from the resubscription operator, or moving the resubscription operator itself further upstream.

Caution

All resubscription operators should be applied with care to anonymous branch points in the workflow, since dangling branches operate independently from each other, and from the subscription to the source sequence. For more details, see Subjects.

public class Repeat : Combinator
Inheritance
Repeat
Inherited Members

Methods

Process<TSource>(IObservable<TSource>)

Repeats the observable sequence indefinitely.

public override IObservable<TSource> Process<TSource>(IObservable<TSource> source)

Parameters

source IObservable<TSource>

The observable sequence to repeat.

Returns

IObservable<TSource>

The observable sequence producing the elements of the given sequence repeatedly and sequentially.

Type Parameters

TSource

The type of the elements in the source sequence.