safwank / ElixirRetry

Simple Elixir macros for linear retry, exponential backoff and wait with composable delays
Other
441 stars 32 forks source link

Current jitter implementation is not very practical #58

Closed a3kov closed 1 year ago

a3kov commented 1 year ago

It is too extreme IMO - if you include it in the stream pipe, it can completely break the base stream. For example, with exponential backoff, it can produce values that don't grow or even go lower. It should probably work in a percentage margin based on the original value, where the percentage is provided as the function argument.

I understand it's very easy to make own implementation, but maybe this will help future users of this library if fixed.

a3kov commented 1 year ago

Actually what I expected from jitter is implemented by randomize