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.
Instance Variable _client Undocumented
Instance Variable _id_or_token Undocumented
def __init__(self, client: Client, id_or_token: Union[AsyncActivityIDReference, bytes]): (source)

Create an async activity handle.

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

Complete the activity.

Parameters
result:Optional[Any]Result of the activity if any.
rpc_metadata:Mapping[str, str]Headers used on the RPC call. Keys here override client-level RPC metadata keys.
rpc_timeout:Optional[timedelta]Optional RPC deadline to set for the RPC call.
async def fail(self, error: Exception, *, last_heartbeat_details: Sequence[Any] = [], rpc_metadata: Mapping[str, str] = {}, rpc_timeout: Optional[timedelta] = 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]Headers used on the RPC call. Keys here override client-level RPC metadata keys.
rpc_timeout:Optional[timedelta]Optional RPC deadline to set for the RPC call.
async def heartbeat(self, *details: Any, rpc_metadata: Mapping[str, str] = {}, rpc_timeout: Optional[timedelta] = None): (source)

Record a heartbeat for the activity.

Parameters
*details:AnyDetails of the heartbeat.
rpc_metadata:Mapping[str, str]Headers used on the RPC call. Keys here override client-level RPC metadata keys.
rpc_timeout:Optional[timedelta]Optional RPC deadline to set for the RPC call.
async def report_cancellation(self, *details: Any, rpc_metadata: Mapping[str, str] = {}, rpc_timeout: Optional[timedelta] = None): (source)

Report the activity as cancelled.

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

Undocumented

_id_or_token = (source)

Undocumented