Skip to main content

MessagePartGatherSerializer

This class provides a specialized serialization mechanism for aggregating pre-serialized Message objects. It joins a list of serialized message strings into a single JSON-formatted array and encodes the resulting string using the latin-1 character set.

Methods


dumps()

@classmethod
def dumps(
obj: list[str]
) - > bytes

The parameter is an already serialized list of Message objects. No need to serialize it again, only join the list together and encode it.

Parameters

NameTypeDescription
objlist[str]A list of strings where each string is a pre-serialized Message object to be aggregated

Returns

TypeDescription
bytesA latin-1 encoded byte string representing a JSON array of the serialized message objects