def run(self):
if not self.coordinator.enabled:
return
log.debug("Coordinator thread for %s starting: %s" %
(self.coordinator.filesystem, threading.current_thread()))
while not self._stopping.is_set():
# Keep agents busy
self.generate_actions_for_agents()
# Stack up waiting actions
if bool(random.getrandbits(1)):
self.unassigned_requests.put(self.get_random_action())
self.cull_completed_requests()
# TODO: Very infrequently, randomly cancel an agent action
self._stopping.wait(HSM_COORDINATOR_LOOP_INTERVAL)
fake_hsm_coordinator.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录