class documentation

Composite payload converter that delegates to a list of encoding payload converters.

Encoding/decoding are attempted on each payload converter successively until it succeeds.

Method __init__ Initializes the data converter.
Method from_payloads Decode values trying each converter.
Method get_converters_with_context Return converter instances with context set.
Method to_payloads Encode values trying each converter.
Method with_context Return a new instance with context set on the component converters.
Instance Variable converters List of payload converters to delegate to, in order.
Method _set_converters Undocumented
Property _any_converter_takes_context Undocumented

Inherited from PayloadConverter:

Method from_payload Convert a single payload to a value.
Method from_payloads_wrapper from_payloads for the temporalio.api.common.v1.Payloads wrapper.
Method to_payload Convert a single value to a payload.
Method to_payloads_wrapper to_payloads for the temporalio.api.common.v1.Payloads wrapper.
Class Variable default Default payload converter.
def __init__(self, *converters: EncodingPayloadConverter): (source)

Initializes the data converter.

Parameters
*converters:EncodingPayloadConverterPayload converters to delegate to, in order.
def from_payloads(self, payloads: Sequence[temporalio.api.common.v1.Payload], type_hints: list[type] | None = None) -> list[Any]: (source)

Decode values trying each converter.

See base class. Always returns the same number of values as payloads.

Raises
KeyErrorUnknown payload encoding
RuntimeErrorError during decode
def get_converters_with_context(self, context: SerializationContext) -> list[EncodingPayloadConverter] | None: (source)

Return converter instances with context set.

If no converter uses context, return None.

def to_payloads(self, values: Sequence[Any]) -> list[temporalio.api.common.v1.Payload]: (source)

Encode values trying each converter.

See base class. Always returns the same number of payloads as values.

Raises
RuntimeErrorNo known converter
def with_context(self, context: SerializationContext) -> Self: (source)

Return a new instance with context set on the component converters.

If none of the component converters returned new instances, return self.

List of payload converters to delegate to, in order.

def _set_converters(self, *converters: EncodingPayloadConverter): (source)

Undocumented

_any_converter_takes_context: bool = (source)

Undocumented