zk_update_monitor.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:kingpin 作者: pinterest 项目源码 文件源码
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)
                )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号