class PayloadCodec(ABC): (source)
Known subclasses: temporalio.worker._workflow._CommandAwarePayloadCodec
Codec for encoding/decoding to/from bytes.
Commonly used for compression or encryption.
| Async Method | decode |
Decode the given payloads. |
| Async Method | decode |
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 |
decode for the temporalio.api.common.v1.Payloads wrapper. |
| Async Method | encode |
Encode the given payloads. |
| Async Method | encode |
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 |
encode for the temporalio.api.common.v1.Payloads wrapper. |
| Async Method | _apply |
Undocumented |
async def decode(self, payloads:
Sequence[ temporalio.api.common.v1.Payload]) -> list[ temporalio.api.common.v1.Payload]:
(source)
¶
temporalio.worker._workflow._CommandAwarePayloadCodecDecode the given payloads.
| Parameters | |
payloads:Sequence[ | Payloads to decode. This value should not be mutated. |
| Returns | |
list[ | 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. |
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 encode(self, payloads:
Sequence[ temporalio.api.common.v1.Payload]) -> list[ temporalio.api.common.v1.Payload]:
(source)
¶
temporalio.worker._workflow._CommandAwarePayloadCodecEncode the given payloads.
| Parameters | |
payloads:Sequence[ | Payloads to encode. This value should not be mutated. |
| Returns | |
list[ | 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. |
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.
encode for the
temporalio.api.common.v1.Payloads wrapper.
This replaces the payloads within the wrapper.
temporalio.api.failure.v1.Failure, cb: Callable[ [ temporalio.api.common.v1.Payloads], Awaitable[ None]]):
(source)
¶
Undocumented