Latest 0.9.0
Homepage https://github.com/SwingDev/RxSwiftAutoRetry
License MIT
Platforms ios 8.0
Dependencies RxSwift
Authors

CI Status
Version
License
Platform

RxSwiftAutoRetry is an extension to RxSwift – a well-known Reactive Swift framework.
It allows user to retry observable after exponential time. It also provides simple way to randomize time of delay.

Example

To run the example project, clone the repo, and run pod install from the root project directory first.

Requirements

  • iOS 8.0+

    Installation

    From CocoaPods

    CocoaPods is a dependency manager, which simplifies adding 3rd-party libraries. To install it, add the following line to your Podfile:

pod 'RxSwiftAutoRetry'

Then, you need to run below comand to install framework into your project:

pod install

Usage

See sample project in Example folder.

retryExponentially is extension method for RxSwift framework (in case to use this method please import RxSwift library.)

Usually using this method looks like it:

observable.retryExponentially()

This method provides set of default values for parameters so its behavior can be customized:

observable.retryExponentially(2, with: 0.9...1.1, scheduler: scheduler) { error in
//Add code
}
Parameters
  • maxAttemptCount – Maximum number of times to repeat the sequence.
  • jitter – Multiplier which randomize delay time. Randomizing value is chosen from given range.
  • scheduler – Scheduler on which the delay will be conducted
  • onRetry – Action which will be invoked after delay on every retry. This is optional parameter.
Default values
  • maxAttemptCount: 3
  • jitter: 0.9...1.1
  • scheduler: ConcurrentDispatchQueueScheduler(queue: DispatchQueue.global())
  • onRetry: nil

    License

RxSwiftAutoRetry is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "RxSwiftAutoRetry",
    "version": "0.9.0",
    "summary": "RxSwiftAutoRetry allows user to retry stream after exponential time",
    "swift_version": "4.2",
    "homepage": "https://github.com/SwingDev/RxSwiftAutoRetry",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Krystian Bujak": "[email protected]"
    },
    "source": {
        "git": "https://github.com/SwingDev/RxSwiftAutoRetry.git",
        "tag": "0.9.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "Source/*.swift",
    "dependencies": {
        "RxSwift": [
            "~> 4.4"
        ]
    }
}

Pin It on Pinterest

Share This