class documentation
class AsyncActivityHandle(WithSerializationContext): (source)
Constructor: AsyncActivityHandle(client, id_or_token, data_converter_override)
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 |
Report the activity as cancelled. |
Method | with |
Create a new AsyncActivityHandle with a different serialization context. |
Instance Variable | _client |
Undocumented |
Instance Variable | _data |
Undocumented |
Instance Variable | _id |
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 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:Exception | Error for the activity. |
lastSequence[ | Last heartbeat details for the activity. |
rpcMapping[ | Headers used on the RPC call. Keys here override client-level RPC metadata keys. |
rpctimedelta | None | Optional 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.