class CompositePayloadConverter(PayloadConverter, WithSerializationContext): (source)
Known subclasses: temporalio.contrib.pydantic.PydanticPayloadConverter
, temporalio.converter.DefaultPayloadConverter
Constructor: CompositePayloadConverter(*converters)
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 |
Decode values trying each converter. |
Method | get |
Return converter instances with context set. |
Method | to |
Encode values trying each converter. |
Method | with |
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 |
Undocumented |
Property | _any |
Undocumented |
Inherited from PayloadConverter
:
Method | from |
Convert a single payload to a value. |
Method | from |
from_payloads for the temporalio.api.common.v1.Payloads wrapper. |
Method | to |
Convert a single value to a payload. |
Method | to |
to_payloads for the temporalio.api.common.v1.Payloads wrapper. |
Class Variable | default |
Default payload converter. |
temporalio.contrib.pydantic.PydanticPayloadConverter
, temporalio.converter.DefaultPayloadConverter
Initializes the data converter.
Parameters | |
*converters:EncodingPayloadConverter | Payload converters to delegate to, in order. |
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 | |
KeyError | Unknown payload encoding |
RuntimeError | Error during decode |
SerializationContext
) -> list[ EncodingPayloadConverter] | None
:
(source)
¶
Return converter instances with context set.
If no converter uses context, return None.
Encode values trying each converter.
See base class. Always returns the same number of payloads as values.
Raises | |
RuntimeError | No known converter |
Return a new instance with context set on the component converters.
If none of the component converters returned new instances, return self.