QueueEvent#
- class wattson.util.events.queue_event.QueueEvent(max_queue_time_s: float = 5, max_wait_time_s: float = 0.2, max_queue_interval_s: float = 0)#
Bases:
Event
Methods
A QueueEvent allows subscribers to queue setting this event and wait for other clients to set it as well.
Reset the internal flag to false.
Return true if and only if the internal flag is true.
Return true if and only if the internal flag is true.
queue
Set the internal flag to true.
set_max_queue_interval_s
- __init__(max_queue_time_s: float = 5, max_wait_time_s: float = 0.2, max_queue_interval_s: float = 0)#
A QueueEvent allows subscribers to queue setting this event and wait for other clients to set it as well. Thus, multiple queues get accumulated to a single trigger of this event
- Parameters:
max_queue_time_s (float, optional) – How long to wait at most before triggering this event (after at least one client requested triggering) (Default value = 5)
max_wait_time_s (float, optional) – How long to wait for another client before triggering (Default value = 0.2)
max_queue_interval_s (float, optional) – How many seconds to wait at least between clearing and triggering. (Default value = 0)
- clear() None #
Reset the internal flag to false.
Subsequently, threads calling wait() will block until set() is called to set the internal flag to true again.
- isSet() bool #
Return true if and only if the internal flag is true.
This method is deprecated, use is_set() instead.
- is_set() bool #
Return true if and only if the internal flag is true.
- set() None #
Set the internal flag to true.
All threads waiting for it to become true are awakened. Threads that call wait() once the flag is true will not block at all.