wait¶
-
BetterEvent.wait(timeout: Optional[Union[int, float]] = None, fail=False) → bool[source]¶ Multi-purpose
waitmethod which works similarly tothreading.Event.wait()but with some extra features.This method’s behaviour will vary depending on what the
wait_onsetting is set to:'set'- the default - works likethreading.Event,wait()only triggers when the event is in the “set” state, i.e._flagisTrue'clear'- opposite of the default - works opposite tothreading.Event,wait()only triggers when the event is in the “clear” state, i.e._flagisFalse'both'- In thebothsetting,wait()will simply wait until_flagis changed, whether fromsettoclear, orcleartoset. This wait_on setting only works as long asnotify_setandnotify_clearare set toTrue
- Parameters
- Return bool signal
This method returns the internal flag on exit, so it will always return
Trueexcept if a timeout is given and the operation times out.