Bases: object
A class that listens for an event with a specific value
Note: Since this class stores for each event value the last timestamp when it occured, it should only be used for events for which the event value domain (possible values) is limited and well known (ex: an enum)
Clears the internal event buffer
Notifies that a given event has arrived This function is protected inside with the object’s lock. Do NOT call this function when you have the lock acquired on this object.
Parameters: | v (object) – event value |
---|
Locks this event listener
Unlocks this event listener
Wait for an event with the given value. You MUST protect this function with this object’s lock before calling this method and always unlock it afterward, of course:
from taurus.core.util.event import EventListener
class MyEvtListener(EventListener):
# Your specific listener code here
pass
evt_listener = EventListener()
try:
evt_listener.lock()
t = time.time()
go()
evt_listener.waitEvent(Stop, t)
finally:
evt_listener.unlock()
Parameters: |
---|