A simple backoff algorithm in C#
var backoff = new gbase.Backoff();
double firstDuration = backoff.GetDuration(); // will be 1
double secondDuration = backoff.GetDuration(); // will be 2 ... etc.
Adding randomization to the backoff durations. See Amazon's writeup of performance gains using jitter.
var backoff = new gbase.Backoff();
backoff.EnableJitter(true); // enable Jitter