You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ApexyURLSession is very lightweight and useful. I want use Apexy without Alamofire in my case.
But, ApexyAlamofire has injected RequestInterceptor with method:
open func retry(
_ request: Request,
for session: Session,
dueTo error: Error,
completion: @escaping (RetryResult) -> Void)
Using this method very useful. What do you all think about an idea add a protocol RequestRetrier? It has enum RetryResult (copied from Alamofire):
/// Outcome of determination whether retry is necessary.
public enum RetryResult {
/// Retry should be attempted immediately.
case retry
/// Retry should be attempted after the associated `TimeInterval`.
case retryWithDelay(TimeInterval)
/// Do not retry.
case doNotRetry
/// Do not retry due to the associated `Error`.
case doNotRetryWithError(Error)
}
Inject him in URLSessionClient init with default implementation
When dataTask/uploadTask error catched, call recursively request/upload methods, when RetryResult equal retry/retryWithDelay
In cases doNotRetry/doNotRetryWithError throw error
I want implement this behaviour, if active community members thinks that my proposal will be useful.
The text was updated successfully, but these errors were encountered:
ApexyURLSession is very lightweight and useful. I want use Apexy without Alamofire in my case.
But, ApexyAlamofire has injected RequestInterceptor with method:
Using this method very useful. What do you all think about an idea add a protocol RequestRetrier? It has enum RetryResult (copied from Alamofire):
I want implement this behaviour, if active community members thinks that my proposal will be useful.
The text was updated successfully, but these errors were encountered: