def _holddown_queue_wiper():
# A greenlet which wakes up every X seconds to clean up
# messages in the holddown queue. It either drops the event
# or put the event back to the _NOTIFICATION_EVENT_QUEUE.
while True:
gevent.sleep(_NOTIFICATION_HOLDDOWN_WIPER_SLEEP_INTERVAL_IN_SECONDS)
while not _NOTIFICATION_HOLDDOWN_QUEUE.empty():
(zk_path, command, value, version, max_wait_in_secs,
watch_type, notification_timestamp) \
= _NOTIFICATION_HOLDDOWN_QUEUE.get()
if (zk_path not in _PATH_TO_DATA) or notification_timestamp \
>= _PATH_TO_DATA[zk_path]['notification_timestamp']:
_NOTIFICATION_EVENT_QUEUE.put(
(zk_path, command, value, version,
max_wait_in_secs, watch_type, notification_timestamp)
)
评论列表
文章目录