ID EN
Threading

wait_for

Python 3.11

Wait until a condition evaluates to true. predicate should be a callable which result will be interpreted as a boolean value. A timeout may be provided giving the maximum time to wait.

Syntax

PYTHON
wait_for(predicate, timeout=None)

Examples

Example 1
PYTHON
while not predicate():
    cv.wait()

See Also

wait() wait()