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_wrapper decode for the temporalio.api.common.v1.Payloads wrapper.
Async Method encode Encode values into payloads.
Async Method encode_wrapper encode for the temporalio.api.common.v1.Payloads wrapper.
Class Variable payload_codec Optional codec for encoding payload bytes.
Class Variable payload_converter Undocumented
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_wrapper(self, payloads: Optional[temporalio.api.common.v1.Payloads], type_hints: Optional[List[Type]] = None) -> List[Any]: (source)

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

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_wrapper(self, values: Sequence[Any]) -> temporalio.api.common.v1.Payloads: (source)

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

payload_codec: Optional[PayloadCodec] = (source)

Optional codec for encoding payload bytes.

payload_converter: PayloadConverter = (source)

Undocumented