get_activity_task
¶
get_activity_task(
activity_arn: Arn,
*,
config_overrides: Optional[SFNClientConfig] = None,
worker_name: Optional[Name] = None,
) -> GetActivityTaskOutput
Used by workers to retrieve a task (with the specified activity ARN) which has been scheduled for execution by a running state machine. This initiates a long poll, where the service holds the HTTP connection open and responds as soon as a task becomes available (i.e. an execution of a task of this type is needed.) The maximum time the service holds on to the request before responding is 60 seconds. If no task is available within 60 seconds, the poll returns a taskToken with a null string.
Workers should set their client side socket timeout to at least 65 seconds (5 seconds higher than the maximum time the service may hold the poll request).
Polling with GetActivityTask can cause latency in some implementations. See Avoid Latency When Polling for Activity Tasks in the Step Functions Developer Guide.
Parameters:
-
activity_arn(Arn) –The Amazon Resource Name (ARN) of the activity to retrieve tasks from (assigned when you create the task using CreateActivity.)
-
worker_name(Optional[Name], default:None) –You can provide an arbitrary name in order to identify the worker that the task is assigned to. This name is used when it is logged in the execution history.
Raises:
-
ActivityDoesNotExist–The specified activity does not exist.
-
ActivityWorkerLimitExceeded–The maximum number of workers concurrently polling for activity tasks has been reached.
-
InvalidArn–The provided Amazon Resource Name (ARN) is not valid.
-
KmsAccessDeniedException–Either your KMS key policy or API caller does not have the required permissions.
-
KmsInvalidStateException–The KMS key is not in valid state, for example: Disabled or Deleted.
-
KmsThrottlingException–Received when KMS returns
ThrottlingExceptionfor a KMS call that Step Functions makes on behalf of the caller. -
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_sfn/_services/sfn.py
1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 | |