Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
brandon2727 opened this issue May 24, 2022 · 0 comments
Open

Comments

@brandon2727
Copy link

brandon2727 commented May 24, 2022

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)
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant