Serialization Registry

This module provides a centralized registry for high-performance serialization logic. It defines how domain models are encoded and decoded when interacting with external systems like distributed caches, message brokers, or database drivers.

MsgSpec Integration

Core components utilizing msgpack for compact binary representation.

class MsgSpecRegistry[source]

Bases: object

Registry for msgspec-based serialization.

_ENCODER = <msgspec.msgpack.Encoder object>

Internal msgpack encoder instance.

classmethod get_cashews_pair(target_type: Any) tuple[Callable[[Any, Any, Any], Awaitable[bytes]], Callable[[bytes, Any, Any], Awaitable[Any]]][source]

Create an asynchronous encoder/decoder pair for a specific type.

Registration Logic

cashews_registry() None[source]

Register domain data models with the cashews serialization system.