temporalio.client.AsyncActivityHandle

Handle representing an external activity for completion and heartbeat.

Method __init__ Create an async activity handle.
Async Method complete Complete the activity.
Async Method fail Fail the activity.
Async Method heartbeat Record a heartbeat for the activity.
Async Method report_cancellation Report the activity as cancelled.
Method with_context Create a new AsyncActivityHandle with a different serialization context.
Instance Variable _client Undocumented
Instance Variable _data_converter_override Undocumented
Instance Variable _id_or_token Undocumented

Create an async activity handle.

Complete the activity.

Parameters
result:Any | NoneResult of the activity if any.
rpc_metadata:Mapping[str, str | bytes]Headers used on the RPC call. Keys here override client-level RPC metadata keys.
rpc_timeout:timedelta | NoneOptional RPC deadline to set for the RPC call.

Fail the activity.

Parameters
error:ExceptionError for the activity.
last_heartbeat_details:Sequence[Any]Last heartbeat details for the activity.
rpc_metadata:Mapping[str, str | bytes]Headers used on the RPC call. Keys here override client-level RPC metadata keys.
rpc_timeout:timedelta | NoneOptional RPC deadline to set for the RPC call.

Record a heartbeat for the activity.

Parameters
*details:AnyDetails of the heartbeat.
rpc_metadata:Mapping[str, str | bytes]Headers used on the RPC call. Keys here override client-level RPC metadata keys.
rpc_timeout:timedelta | NoneOptional RPC deadline to set for the RPC call.

Report the activity as cancelled.

Parameters
*details:AnyCancellation details.
rpc_metadata:Mapping[str, str | bytes]Headers used on the RPC call. Keys here override client-level RPC metadata keys.
rpc_timeout:timedelta | NoneOptional RPC deadline to set for the RPC call.

Create a new AsyncActivityHandle with a different serialization context.

Payloads received by the activity will be decoded and deserialized using a data converter with ActivitySerializationContext set as context. If you are using a custom data converter that makes use of this context then you can use this method to supply matching context data to the data converter used to serialize and encode the outbound payloads.