Comment additions for exponential backoff

Change-Id: If43d6e5ceedc17b1763ecd8a244f959150b802e1
This commit is contained in:
Joshua Harlow
2013-10-13 22:59:14 +00:00
parent a682717f73
commit 0ff51a5c92

View File

@@ -113,6 +113,10 @@ class AttrDict(dict):
class ExponentialBackoff(object):
"""An iterable object that will yield back an exponential delay sequence
provided an exponent and a number of items to yield. This object may be
iterated over multiple times (yielding the same sequence each time).
"""
def __init__(self, attempts, exponent=2):
self.attempts = int(attempts)
self.exponent = exponent