Single<T>.retry constructor

Single<T>.retry(
  1. Single<T> singleFactory(), [
  2. int? count
])

Creates a Single that will recreate and re-listen to the source Single the specified number of times until the Single terminates successfully.

If the retry count is not specified (is null), it retries indefinitely.

If the retry count is met, but the Single has not terminated successfully, the first error and StackTrace that caused the failure will be emitted.

See Rx.retry and RetryStream.

Implementation

factory Single.retry(Single<T> Function() singleFactory, [int? count]) =>
    Rx.retry(singleFactory, count).takeFirstDataOrFirstErrorAndClose();