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

Class SingleNotifyPipeCondition

source code


Condition which can only be notified once.

This condition class uses pipes and poll, internally, to be able to wait for notification with a timeout, without resorting to polling. It is almost compatible with Python's threading.Condition, with the following differences:

Nested Classes [hide private]
  _waiter_class
Helper class for SingleNotifyPipeCondition
Instance Methods [hide private]
 
__init__(self, lock)
Constructor for SingleNotifyPipeCondition
source code
 
_check_unnotified(self)
Throws an exception if already notified.
source code
 
_Cleanup(self)
Cleanup open file descriptors, if any.
source code
 
wait(self, timeout)
Wait for a notification.
source code
 
notifyAll(self)
Close the writing side of the pipe to notify all waiters.
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, lock)
(Constructor)

source code 

Constructor for SingleNotifyPipeCondition

Parameters:
  • lock - condition base lock
Overrides: object.__init__

wait(self, timeout)

source code 

Wait for a notification.

Parameters:
  • timeout (float or None) - Waiting timeout (can be None)