mstar.communication.codec#
The encode/decode seam shared by both ZMQ transports.
Kept apart from either communicator so they can both import it, and mirroring
the Rust Codec trait:
pub trait Codec<M> {
fn encode(msg: &M) -> Result<Vec<u8>, CommError>;
fn decode(bytes: &[u8]) -> Option<M>;
}
The transport never looks inside the bytes, so moving an edge to another encoding is a codec change, never a transport change.
Functions
|
Decode a drained batch one frame at a time. |
Select typed msgpack; reject the removed pickle codec at startup. |
Classes
|
|
Raw msgpack, no schema: for edges whose payloads are already plain dicts and whose other end is not Python — the Rust |
|
Typed msgpack ( |
- class mstar.communication.codec.MsgpackCodec[source]#
Bases:
CodecRaw msgpack, no schema: for edges whose payloads are already plain dicts and whose other end is not Python — the Rust
mstar-serverfrontend bridge.default=stris lossy, so this is NOT a general replacement for pickle; useWireCodecfor message dataclasses.
- class mstar.communication.codec.WireCodec[source]#
Bases:
CodecTyped msgpack (
mstar.communication.wire): language-neutral and lossless for the message dataclasses. The default.