google / google/promises

Question. Is it possible to change the delay time between retrys?

Open
#184 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
3.8k
Forks
316
PR merge metrics
No merged PRs in 30d

Description

Not an issue. Just a question. Is it possible to change the delay time between promise retrys? I would like to implement the Exponential Backoff and Retry Pattern with different time intervals. This is what I have so far

public static func genericRequestWithRetry(with api: EndPoint) -> Promise {

let customQueue = DispatchQueue(label: "GenericRequestQueue", qos: .userInitiated)

return retry(on: customQueue, attempts: 3, delay: 2, condition: { remainingAttempts, error in

// here I would like to change the delay value and then retry

}
) {
genericRequest(with: api)
}
}

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.