コード例 #1
0
ファイル: worker.py プロジェクト: jjlittlejohn/abaco
 def get(self, actor_id):
     try:
         Actor.from_db(actors_store[actor_id])
     except KeyError:
         raise APIException("actor not found: {}'".format(actor_id), 400)
     try:
         workers = get_workers(actor_id)
     except WorkerException as e:
         raise APIException(e.message, 404)
     return ok(result=workers, msg="Workers retrieved successfully.")
コード例 #2
0
ファイル: worker.py プロジェクト: jjlittlejohn/abaco
def shutdown_workers(actor_id):
    """Graceful shutdown of all workers for an actor"""
    workers = get_workers(actor_id)
    for worker in workers:
        ch = WorkerChannel(name=worker["ch_name"])
        ch.put("stop")