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
I was looking through the codebase and didn't find(maybe just search not thourough enough) an option to set a value which will be used to calculate an addition to delay using randomness. In retry.JitterBackoff I noticed that it uses delay itself for such puprose.
What I mean is following...
Here is the definition of Backoff's apply: def apply(max: Int = 8, delay: FiniteDuration = Defaults.delay, base: Int = 2). So retry.Backoff(3, 1.second) means that 1st retry will be exactly after 1 second, 2nd retry after 2 seconds, and 3rd retry after 4 seconds.
What I want to achieve is next: 1st retry after (1 + random(0, N)) second, 2nd retry after 2*(1 + random(0, N)) + random(0, N) seconds, and 3rd retry after 2*( 2*(1 + random(0, N)) + random(0, N) ) + random(0, N) seconds.
There is a JitterBackoff but seems for aformentioned N it uses initial delay value.
Is such functionality supported?
PS. I'm neglacting cap here
The text was updated successfully, but these errors were encountered:
I was looking through the codebase and didn't find(maybe just search not thourough enough) an option to set a value which will be used to calculate an addition to
delay
using randomness. Inretry.JitterBackoff
I noticed that it uses delay itself for such puprose.What I mean is following...
Here is the definition of Backoff's apply:
def apply(max: Int = 8, delay: FiniteDuration = Defaults.delay, base: Int = 2)
. Soretry.Backoff(3, 1.second)
means that 1st retry will be exactly after 1 second, 2nd retry after 2 seconds, and 3rd retry after 4 seconds.What I want to achieve is next: 1st retry after
(1 + random(0, N))
second, 2nd retry after2*(1 + random(0, N)) + random(0, N)
seconds, and 3rd retry after2*( 2*(1 + random(0, N)) + random(0, N) ) + random(0, N)
seconds.There is a
JitterBackoff
but seems for aformentionedN
it uses initialdelay
value.Is such functionality supported?
PS. I'm neglacting
cap
hereThe text was updated successfully, but these errors were encountered: