Exponention back-off #3

petemounce opened this Issue Jan 24, 2013 · 0 comments


None yet
1 participant

It'd be great if as well as passing a number to sleep, it were possible to pass a lambda so one could do things like

retryable(...., tries: 4, sleep: lambda{|s| 4**s} ....) do
  unsafe thing

and it would retry after 1, 4, 16, and 64s. I guess that could be achieved by clever use of the callbacks to modify a variable that was used as the sleep parameter, but that seems complicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment