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_wrapper decode for the temporalio.api.common.v1.Payloads wrapper.
Async Method encode Encode the given payloads.
Async Method encode_wrapper encode for the temporalio.api.common.v1.Payloads wrapper.
@abstractmethod
async def decode(self, payloads: Sequence[temporalio.api.common.v1.Payload]) -> List[temporalio.api.common.v1.Payload]: (source)

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_wrapper(self, payloads: temporalio.api.common.v1.Payloads): (source)

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

This replaces the payloads within.

@abstractmethod
async def encode(self, payloads: Sequence[temporalio.api.common.v1.Payload]) -> List[temporalio.api.common.v1.Payload]: (source)

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_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.