ExpBackoffRetry
open class ExpBackoffRetry : RetryProtocol
Class for handling retries for network requests
-
Config for retries
See moreDeclaration
Swift
public struct Config -
Number of performed retries
Declaration
Swift
open private(set) var retryCount: UInt { get } -
Retry config
Declaration
Swift
public let config: Config -
Default init
Declaration
Swift
public convenience init() -
Init
Declaration
Swift
public init(config: Config)Parameters
configRetry config
-
Decire on retry in case of error
Declaration
Swift
public func retryChoice(for request: ServiceRequest, with error: Error) -> RetryChoiceParameters
requestRequest to retry
errorResponse receiver from service
Return Value
Retry choice
-
Decide on retry in case of success
Declaration
Swift
public func retryChoice(for request: ServiceRequest, with response: Response) -> RetryChoiceParameters
requestRequest to retry
responseResponse receiver from service
Return Value
Retry choice
-
Declaration
Swift
public enum ExpBackoffRetryError : Error -
Next delauy for retry
Throws
RetryError.retryCountExceeded if retry count is maximumDeclaration
Swift
public func nextRetryDelay() throws -> TimeIntervalReturn Value
max(minDelay, rand(0..<min(cap, base * exp ^ retryCount)))
ExpBackoffRetry Class Reference