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
config
Retry config
-
Decire on retry in case of error
Declaration
Swift
public func retryChoice(for request: ServiceRequest, with error: Error) -> RetryChoice
Parameters
request
Request to retry
error
Response 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) -> RetryChoice
Parameters
request
Request to retry
response
Response 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 -> TimeInterval
Return Value
max(minDelay, rand(0..<min(cap, base * exp ^ retryCount)))