def __init__(self, name, arn=None, worker=None, **kwargs):
"""
Args:
name (String): Name of the Activity to monitor
arn (String): Full ARN of Activity to monitor
If not given, it is looked up
If given, the actual ARN and Name are compared
process (callable): Callable that transforms the task's input
into an output that is then returned
kwargs : Arguments to heaviside.utils.create_session
"""
self.name = name
self.arn = arn
self.worker = worker
self.token = None
self.session, self.account_id = create_session(**kwargs)
self.client = self.session.client('stepfunctions', config=Config(read_timeout=70))
self.log = logging.getLogger(__name__)
self.max_concurrent = 0
self.poll_delay = 1
if self.arn is None:
self.arn = self.lookup_activity_arn(name)
else:
try:
resp = self.client.describe_activity(activityArn = self.arn)
if resp['name'] != name:
raise Exception("Name of {} is not {}".format(self.arn, self.name))
except ClientError:
raise Exception("ARN {} is not valid".format(self.arn))
评论列表
文章目录