Package ganeti :: Module mcpu :: Class LockAttemptTimeoutStrategy
[hide private]
[frames] | no frames]

Class LockAttemptTimeoutStrategy

source code


Class with lock acquire timeout strategy.

Instance Methods [hide private]
 
__init__(self, _time_fn=time.time, _random_fn=random.random)
Initializes this class.
source code
 
NextAttempt(self)
Returns the timeout for the next attempt.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  _TIMEOUT_PER_ATTEMPT = _CalculateLockAttemptTimeouts()
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, _time_fn=time.time, _random_fn=random.random)
(Constructor)

source code 

Initializes this class.

Parameters:
  • _time_fn - Time function for unittests
  • _random_fn - Random number generator for unittests
Overrides: object.__init__