Skip to content

)} ,System.Action{--1})} ,System.Action{--1},System.TimeSpan)} ,System.Action{--1},System.Int32)} ,System.Action{--1},System.Int32,System.TimeSpan)} ,System.Action{--1},System.Int32,System.TimeSpan,System.Reactive.Concurrency.IScheduler)}

ReactiveExtensions.OnErrorRetry(IObservable) method

Defined in

Type: ReactiveExtensions Namespace: ReactiveUI.Extensions Assembly: ReactiveUI.Extensions.dll

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481

Overloads

  • 1. public static IObservable<TSource> OnErrorRetry<TSource>(this IObservable<TSource> source)
  • 2. public static IObservable<TSource> OnErrorRetry<TSource, TException>(this IObservable<TSource> source, Action<TException> onError) where TException : Exception
  • 3. public static IObservable<TSource> OnErrorRetry<TSource, TException>(this IObservable<TSource> source, Action<TException> onError, TimeSpan delay) where TException : Exception
  • 4. public static IObservable<TSource> OnErrorRetry<TSource, TException>(this IObservable<TSource> source, Action<TException> onError, int retryCount) where TException : Exception
  • 5. public static IObservable<TSource> OnErrorRetry<TSource, TException>(this IObservable<TSource> source, Action<TException> onError, int retryCount, TimeSpan delay) where TException : Exception
  • 6. public static IObservable<TSource> OnErrorRetry<TSource, TException>(this IObservable<TSource> source, Action<TException> onError, int retryCount, TimeSpan delay, IScheduler delayScheduler) where TException : Exception

1. Overload

public static IObservable<TSource> OnErrorRetry<TSource>(this IObservable<TSource> source)

View source

Summary: Repeats the source until it terminates successfully (alias of Retry).

Type parameters

NameDescription
TSourceElement type.

Parameters

NameTypeDescription
sourceIObservableSource sequence.

Returns: IObservable -- Retried sequence.

2. Overload

public static IObservable<TSource> OnErrorRetry<TSource, TException>(this IObservable<TSource> source, Action<TException> onError) where TException : Exception

View source

Summary: When caught exception, do onError action and repeat observable sequence.

Type parameters

NameDescription
TSourceThe type of the source.
TExceptionThe type of the exception.

Parameters

NameTypeDescription
sourceIObservableThe source.
onErrorActionThe on error.

Returns: IObservable -- A sequence that retries on error with optional delay.

3. Overload

public static IObservable<TSource> OnErrorRetry<TSource, TException>(this IObservable<TSource> source, Action<TException> onError, TimeSpan delay) where TException : Exception

View source

Summary: When caught exception, do onError action and repeat observable sequence after delay time.

Type parameters

NameDescription
TSourceThe type of the source.
TExceptionThe type of the exception.

Parameters

NameTypeDescription
sourceIObservableThe source.
onErrorActionThe on error.
delayTimeSpanThe delay.

Returns: IObservable -- A sequence that retries on error with optional delay.

4. Overload

public static IObservable<TSource> OnErrorRetry<TSource, TException>(this IObservable<TSource> source, Action<TException> onError, int retryCount) where TException : Exception

View source

Summary: When caught exception, do onError action and repeat observable sequence during within retryCount.

Type parameters

NameDescription
TSourceThe type of the source.
TExceptionThe type of the exception.

Parameters

NameTypeDescription
sourceIObservableThe source.
onErrorActionThe on error.
retryCountintThe retry count.

Returns: IObservable -- A sequence that retries on error with optional delay.

5. Overload

public static IObservable<TSource> OnErrorRetry<TSource, TException>(this IObservable<TSource> source, Action<TException> onError, int retryCount, TimeSpan delay) where TException : Exception

View source

Summary: When caught exception, do onError action and repeat observable sequence after delay time during within retryCount.

Type parameters

NameDescription
TSourceThe type of the source.
TExceptionThe type of the exception.

Parameters

NameTypeDescription
sourceIObservableThe source.
onErrorActionThe on error.
retryCountintThe retry count.
delayTimeSpanThe delay.

Returns: IObservable -- A sequence that retries on error with optional delay.

6. Overload

public static IObservable<TSource> OnErrorRetry<TSource, TException>(this IObservable<TSource> source, Action<TException> onError, int retryCount, TimeSpan delay, IScheduler delayScheduler) where TException : Exception

View source

Summary: When caught exception, do onError action and repeat observable sequence after delay time(work on delayScheduler) during within retryCount.

Type parameters

NameDescription
TSourceThe type of the source.
TExceptionThe type of the exception.

Parameters

NameTypeDescription
sourceIObservableThe source.
onErrorActionThe on error.
retryCountintThe retry count.
delayTimeSpanThe delay.
delayScheduler[IScheduler](#The delay scheduler.

Returns: IObservable -- A sequence that retries on error with optional delay.