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.
Tests
To run tests, run carthage update from the root project directory first.
Requirements
iOS 8.0+
macOS 10.9+
Installation
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
Carthage
Carthage is decentralized dependency manager which allows you to keep your dependencies in compiled format.
To install it, add following line to your Cartfile:
github 'SwingDev/RxSwiftAutoRetry'
Next, run carthage update
On your application targets’ Build Phases tab, in the Link Binary With Libraries section, drag and drop RxSwift.framework and RxSwiftAutoRetry.framework from the Carthage/Build folder on disk.
On your application targets’ Build Phases settings tab, click the + icon and choose New Run Script Phase. Create a Run Script in which you specify your shell (ex: /bin/sh), add the following contents to the script area below the shell:
/usr/local/bin/carthage copy-frameworks
Add the paths to the frameworks you want to use under “Input Files”. For example:
RxSwiftAutoRetry
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.Tests
To run tests, run
carthage update
from the root project directory first.Requirements
Installation
CocoaPods
CocoaPods is a dependency manager, which simplifies adding 3rd-party libraries. To install it, add the following line to your Podfile:Then, you need to run below comand to install framework into your project:
Carthage
Carthage is decentralized dependency manager which allows you to keep your dependencies in compiled format.
carthage update
RxSwift.framework
andRxSwiftAutoRetry.framework
from the Carthage/Build folder on disk.Swift Package Manager
Swift Package Manager is is a tool for managing the distribution of Swift code and integrating it into compiler.It only works with macOS.
Add dependency to your
Package.swift
file:Then, run below command:
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:
This method provides set of default values for parameters so its behavior can be customized:
Parameters
Default values
3
0.9...1.1
ConcurrentDispatchQueueScheduler(queue: DispatchQueue.global())
nil
License
RxSwiftAutoRetry is available under the MIT license. See the LICENSE file for more info.