rholder/guava-retrying — pull request #9 by joschi (2013-12-03 22:23:55+00:00)
Title: Implement FibonacciWaitStrategy

Similar to the `ExponentialWaitStrategy` the `FibonacciWaitStrategy` follows a pattern of waiting an increasing amount of time after each failed attempt.

Instead of an exponential function it's (obiously) using a [Fibonacci sequence](https://en.wikipedia.org/wiki/Fibonacci_numbers) to calculate the wait time.

Depending on the problem at hand the `FibonacciWaitStrategy` might perform better and lead to a better throughput than the `ExponentialWaitStrategy` – at least according to [A Performance Comparison of Different Backoff Algorithms under Different Rebroadcast Probabilities for MANETs](http://www.comp.leeds.ac.uk/ukpew09/papers/12.pdf).

The implementation of `FibonacciWaitStrategy` is using a iterative version of the Fibonacci because a (naive) recursive version will lead to a [StackOverflowError](http://docs.oracle.com/javase/7/docs/api/java/lang/StackOverflowError.html) at a certain point (although very unlikely with useful parameters for retrying).

Hat tip to https://paperairoplane.net/?p=640 which made me want to implement it in guava-retrying. :wink: