Class Retry
Represents an operator that repeats an observable sequence until it successfully terminates.
Retry
reacts to exceptional 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 completes successfully, the result sequence will also complete, 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 Retry : Combinator
- Inheritance
-
Retry
- Inherited Members
Methods
Process<TSource>(IObservable<TSource>)
Repeats the observable sequence until it successfully terminates.
public override IObservable<TSource> Process<TSource>(IObservable<TSource> source)
Parameters
source
IObservable<TSource>The observable sequence to repeat until it successfully terminates.
Returns
- IObservable<TSource>
The observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
Type Parameters
TSource
The type of the elements in the
source
sequence.