def _notification_processor():
while True:
(zk_path, command, value, version, max_wait_in_secs,
watch_type, notification_timestamp) = _NOTIFICATION_EVENT_QUEUE.get()
if zk_path == "kill":
_kill("Restart via kill api")
# ignore all notifications with an older version
if _is_older_version(zk_path, version, notification_timestamp):
continue
# TODO: we need to deal with it if the number of spawned greenlets
# becomes an issue.
gevent.spawn(_process_notification, command, value, version,
max_wait_in_secs, watch_type, zk_path,
notification_timestamp)
评论列表
文章目录