Closed bamorim closed 5 years ago
We've observed this too 🙂 It'd be nice to see a fix for it
I'll look into it this weekend, fingers crossed.
@bamorim @Dzol Sorry it took me awhile, but here's what I'm thinking of doing.
lin_backoff/2
to maintain backwards compatibilitydef linear_backoff(delay \\ 100) do
Stream.repeatedly(fn -> delay end)
end
What do you think?
@safwank then this is not a linear backoff but rather a constant backoff. IMO, linear should increase by a constant rate a
, starting with some value b
, so then it fits a curve a*x + b
@bamorim You're right. I'll rename the above function to const_backoff/1
and introduce a new one called linear_backoff/2
that really really :) returns a stream of linearly increasing delays.
@bamorim If you want, you can review the latest commits before I release v0.11.
Sorry to ask that question, but your
lin_backoff
is actually exponential. Actually, it yields the same numbers asexp_backoff
if factor is 2.I can open a PR for this, but what I'd suggest is to just have the lin_backoff named exp_backoff and set the factor default to 2.
Then we can implement a lin_backoff like that:
What do you think?
EDIT: fixed typo (
last_delay
->initial_delay
)