class documentation

class DataConverter: (source)

View In Hierarchy

Data converter for converting and encoding payloads to/from Python values.

This combines PayloadConverter which converts values with PayloadCodec which encodes bytes.

Method __post_init__ Undocumented
Async Method decode Decode payloads into values.
Async Method decode_failure Decode and convert failure.
Async Method decode_wrapper decode for the temporalio.api.common.v1.Payloads wrapper.
Async Method encode Encode values into payloads.
Async Method encode_failure Convert and encode failure.
Async Method encode_wrapper encode for the temporalio.api.common.v1.Payloads wrapper.
Class Variable default Singleton default data converter.
Class Variable failure_converter Failure converter created from the failure_converter_class.
Class Variable payload_codec Optional codec for encoding payload bytes.
Class Variable payload_converter Payload converter created from the payload_converter_class.
def __post_init__(self): (source)

Undocumented

async def decode(self, payloads: Sequence[temporalio.api.common.v1.Payload], type_hints: Optional[List[Type]] = None) -> List[Any]: (source)

Decode payloads into values.

First decodes payloads using codec then converts payloads to values.

Parameters
payloads:Sequence[temporalio.api.common.v1.Payload]Payloads to be decoded and converted.
type_hints:Optional[List[Type]]Undocumented
Returns
List[Any]Decoded and converted values.
async def decode_failure(self, failure: temporalio.api.failure.v1.Failure) -> BaseException: (source)

Decode and convert failure.

async def decode_wrapper(self, payloads: Optional[temporalio.api.common.v1.Payloads], type_hints: Optional[List[Type]] = None) -> List[Any]: (source)
async def encode(self, values: Sequence[Any]) -> List[temporalio.api.common.v1.Payload]: (source)

Encode values into payloads.

First converts values to payloads then encodes payloads using codec.

Parameters
values:Sequence[Any]Values to be converted and encoded.
Returns
List[temporalio.api.common.v1.Payload]Converted and encoded payloads. Note, this does not have to be the same number as values given, but must be at least one and cannot be more than was given.
async def encode_failure(self, exception: BaseException, failure: temporalio.api.failure.v1.Failure): (source)

Convert and encode failure.

Singleton default data converter.

failure_converter: FailureConverter = (source)

Failure converter created from the failure_converter_class.

Optional codec for encoding payload bytes.

payload_converter: PayloadConverter = (source)

Payload converter created from the payload_converter_class.