Package ganeti :: Module locking :: Class RunningTimeout
[hide private]
[frames] | no frames]

Class RunningTimeout

source code


Class to calculate remaining timeout when doing several operations.

Instance Methods [hide private]
 
__init__(self, timeout, allow_negative, _time_fn=time.time)
Initializes this class.
source code
 
Remaining(self)
Returns the remaining timeout.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, timeout, allow_negative, _time_fn=time.time)
(Constructor)

source code 

Initializes this class.

Parameters:
  • timeout (float) - Timeout duration
  • allow_negative (bool) - Whether to return values below zero
  • _time_fn - Time function for unittests
Overrides: object.__init__