Table of Contents

Class: Condition ./src/peak/events/sources.py

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.

Base Classes   
WritableAsCondition
Methods   
__init__
  __init__ 
__init__ ( self,  value=NOT_GIVEN )


Table of Contents

This document was automatically generated on Mon Jan 6 01:11:04 2025 by HappyDoc version 2.1