Retryable
public protocol Retryable
Represents a Retry
that is associated with Configurable
.
configuration.retry
by default.
Create custom Retryable
protocol HTTPBinRetryable: Retryable { }
extension HTTPBinRetryable {
var retry: Retry {
var retry = Retry()
retry.retryErrorCodes = [.timedOut,.networkConnectionLost]
retry.retryInterval = 20
retry.maxRetryAttempts = 10
return retry
}
}
Using the above Retryable
class HTTPBinStringGETService: Requestable, HTTPBinRetryable {
let path: String = get
let encoding: ParameterEncoding = .URLEncodedInURL
var parameters: Any?
init(parameters: Any?) {
self.parameters = parameters
}
}