Send callbacks/allow tasks to proceed when condition is true
A Condition is very similar to a Value , except in its yielding and
callback behavior. Yielding to a Condition in a task will suspend the
task only if the current value of the Condition is false. If the
Condition has a true value, the task is allowed to proceed, and
events.resume() will return the value of the Condition . If the
Condition has a false value, the task will be suspended until
the value is changed to a true one.
The behavior for callbacks is similar: when a callback is added with
addCallback() , it will be fired immediately if the Condition is true
at the time the callback is added. Otherwise, the callback will be fired
once the Condition becomes true.
|