class documentation

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
def __init__(self, client: Client, id_or_token: AsyncActivityIDReference | bytes, data_converter_override: DataConverter | None = None): (source)

Create an async activity handle.

async def complete(self, result: Any | None = temporalio.common._arg_unset, *, rpc_metadata: Mapping[str, str | bytes] = {}, rpc_timeout: timedelta | None = None): (source)

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.
async def fail(self, error: Exception, *, last_heartbeat_details: Sequence[Any] = [], rpc_metadata: Mapping[str, str | bytes] = {}, rpc_timeout: timedelta | None = None): (source)

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.
async def heartbeat(self, *details: Any, rpc_metadata: Mapping[str, str | bytes] = {}, rpc_timeout: timedelta | None = None): (source)

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.
async def report_cancellation(self, *details: Any, rpc_metadata: Mapping[str, str | bytes] = {}, rpc_timeout: timedelta | None = None): (source)

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.
def with_context(self, context: SerializationContext) -> Self: (source)

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.

Undocumented

_data_converter_override = (source)

Undocumented

_id_or_token = (source)

Undocumented