Package kiwi :: Module tasklet :: Class WaitCondition
[frames | no frames]

Type WaitCondition

object --+
         |
        WaitCondition

Known Subclasses:
WaitForCall, WaitForIdle, WaitForIO, WaitForMessages, WaitForProcess, WaitForSignal, WaitForTasklet, WaitForTimeout

Base class for all wait-able condition objects.

WaitConditions are used in a yield statement inside tasklets body for specifying what event(s) it should wait for in order to receive control once more.
Method Summary
  arm(self, tasklet)
Prepare the wait condition to receive events.
  disarm(self)
Stop the wait condition from receiving events.

Method Details

arm(self, tasklet)

Prepare the wait condition to receive events.

When a wait condition receives the event it is waiting for, it should call the method wait_condition_fired of the tasklet with the wait condition as argument. The method returns True or False; if it returns True, it means the WaitCondition object must "rearm" itself (continue to monitor events), otherwise it should disarm.
Parameters:
tasklet - the tasklet instance the wait condition is to be associated with.

Attention: this method normally should not be called directly by the programmer.

disarm(self)

Stop the wait condition from receiving events.

Attention: this method normally should not be called by the programmer.


Generated by Epydoc 2.1 on Tue Feb 6 10:53:34 2007 http://epydoc.sf.net