-
Notifications
You must be signed in to change notification settings - Fork 4
orEvent
Woong Gyu La edited this page Jul 6, 2016
·
2 revisions
OrEvent
is the event
which waits multiple events and raised the event when any of registered events is raised!
The usage is simple as below:
from pyserver.util import *
from threading import *
...
errorEvent = Event()
successEvent = Event()
...
# wait any of errorEvent or successEvent to be raised indefinitely
OrEvent(errorEvent, successEvent).wait()
...
warningEvent = Event()
...
# wait any of errorEvent, successEvent, or warningEvent to be raised for 10 seconds
OrEvent(errorEvent, successEvent, warningEvent).wait(10.0)