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
Right now I'm stuck with the API, I would like to have a function like this:
cyclicExponentialBackoff::Int->Int->RetryPolicy
cyclicExponentialBackoff base cap =...
That uses exponentialBackoff and once it reaches the cap it starts again from rsIterNumber = 0. Is there someway I could take advantage of the already implemented exponentialBackoff? Any pointers would help, thanks.
The text was updated successfully, but these errors were encountered:
RetryStatus contains, among other things, an rsCumulativeDelay field which you could use for comparison against your cap. Bear in mind though that this number would keep incrementing even after reset so you'd have to modulo the cumulative delay with your cap or something to get the cumulative delay to be within the current reset you're on. If it doesn't divide evenly, modulo may not be correct.
However, you would not be able to actually set rsIterNumber to 0. That is managed by retry and resetting that to 0 wouldn't really be accurate.
You could also do a poor man's version of this and just run exponentialBackoff with limitRetriesByDelayin a loop. This would reset your iter numbers and give you the resetting behavior. However, I strongly recommend you figure out a termination case that you want and roll that into it so you're not retrying forever.
Right now I'm stuck with the API, I would like to have a function like this:
That uses
exponentialBackoff
and once it reaches the cap it starts again from rsIterNumber = 0. Is there someway I could take advantage of the already implementedexponentialBackoff
? Any pointers would help, thanks.The text was updated successfully, but these errors were encountered: