def success(self, output):
"""Marks the task successfully complete and returns the processed data
Note: This method will silently fail if the task has timed out
Args:
output (string|dict): Json response to return to the state machine
"""
if self.token is None:
raise Exception("Not currently working on a task")
output = json.dumps(output)
try:
resp = self.client.send_task_success(taskToken = self.token,
output = output)
except ClientError as e:
# eat the timeout
if not self.is_timeout(e):
self.log.exception("Error sending task success")
raise
finally:
self.token = None # finished with task
评论列表
文章目录