Handles encoding and decoding of network messages using msgpack serialization with length-prefix framing.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Walkercito/repod/llms.txt
Use this file to discover all available pages before exploring further.
Message Format
The protocol uses a 4-byte length-prefix framing format:- Efficient: O(1) boundary detection
- Safe: No delimiter collision risk
- Standard: Used by Kafka, Redis, Protocol Buffers, etc.
Functions
encode()
Dictionary containing the message data. Can include any msgpack-serializable types (dict, list, str, int, float, bool, None).
The encoded message with its 4-byte length prefix.
TypeError: Ifdatacontains non-serializable types.
decode()
This expects raw msgpack data, not a full length-prefixed frame. Use
read_message() for stream-based decoding.Raw msgpack-serialized bytes.
The decoded message dictionary.
msgpack.UnpackException: Ifdatais not valid msgpack.
read_message()
Byte buffer that may contain partial or complete messages.
A
(message, bytes_consumed) tuple. If the stream does not yet contain a full message, returns (None, 0).