Compatibility
- 0.9.15.35.25.15.04.2
- master5.35.25.15.04.2
- 0.9.1iOSmacOS(Intel)macOS(ARM)LinuxtvOSwatchOS
- masteriOSmacOS(Intel)macOS(ARM)LinuxtvOSwatchOS
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.
To run the example project, clone the repo, and run pod install
from the root project directory first.
To run tests, run carthage update
from the root project directory first.
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 is decentralized dependency manager which allows you to keep your dependencies in compiled format.
github 'SwingDev/RxSwiftAutoRetry'
carthage update
RxSwift.framework
and RxSwiftAutoRetry.framework
from the Carthage/Build folder on disk./usr/local/bin/carthage copy-frameworks
$(SRCROOT)/Carthage/Build/<platform>/RxSwift.framework
$(SRCROOT)/Carthage/Build/<platform>/RxSwiftAutoRetry.framework
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:
dependencies: [
.package(url: "https://github.com/SwingDev/RxSwiftAutoRetry.git", from: "0.9"))
]
Then, run below command:
pod install
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
}
3
0.9...1.1
ConcurrentDispatchQueueScheduler(queue: DispatchQueue.global())
nil
RxSwiftAutoRetry is available under the MIT license. See the LICENSE file for more info.