class documentation

class PayloadCodec(ABC): (source)

View In Hierarchy

Codec for encoding/decoding to/from bytes.

Commonly used for compression or encryption.

Async Method decode Decode the given payloads.
Async Method decode_failure Decode payloads of a failure. Intended as a helper method, not for overriding. It is not guaranteed that all failures will be decoded with this method rather than decoding the underlying payloads.
Async Method decode_wrapper decode for the temporalio.api.common.v1.Payloads wrapper.
Async Method encode Encode the given payloads.
Async Method encode_failure Encode payloads of a failure. Intended as a helper method, not for overriding. It is not guaranteed that all failures will be encoded with this method rather than encoding the underlying payloads.
Async Method encode_wrapper encode for the temporalio.api.common.v1.Payloads wrapper.
Async Method _apply_to_failure_payloads Undocumented

Decode the given payloads.

Parameters
payloads:Sequence[temporalio.api.common.v1.Payload]Payloads to decode. This value should not be mutated.
Returns
list[temporalio.api.common.v1.Payload]Decoded payloads. Note, this does not have to be the same number as payloads given, but must be at least one and cannot be more than was given.
async def decode_failure(self, failure: temporalio.api.failure.v1.Failure): (source)

Decode payloads of a failure. Intended as a helper method, not for overriding. It is not guaranteed that all failures will be decoded with this method rather than decoding the underlying payloads.

async def decode_wrapper(self, payloads: temporalio.api.common.v1.Payloads): (source)

decode for the temporalio.api.common.v1.Payloads wrapper.

This replaces the payloads within.

Encode the given payloads.

Parameters
payloads:Sequence[temporalio.api.common.v1.Payload]Payloads to encode. This value should not be mutated.
Returns
list[temporalio.api.common.v1.Payload]Encoded payloads. Note, this does not have to be the same number as payloads given, but must be at least one and cannot be more than was given.
async def encode_failure(self, failure: temporalio.api.failure.v1.Failure): (source)

Encode payloads of a failure. Intended as a helper method, not for overriding. It is not guaranteed that all failures will be encoded with this method rather than encoding the underlying payloads.

async def encode_wrapper(self, payloads: temporalio.api.common.v1.Payloads): (source)

encode for the temporalio.api.common.v1.Payloads wrapper.

This replaces the payloads within the wrapper.

async def _apply_to_failure_payloads(self, failure: temporalio.api.failure.v1.Failure, cb: Callable[[temporalio.api.common.v1.Payloads], Awaitable[None]]): (source)

Undocumented