ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

class documentation

Encode Orionis Realtime v1 using route-selected JSON or MessagePack.

Method __init__ Prepare reusable msgspec codecs without connection or task ownership.
Method decode Decode and validate one client envelope from a complete socket message.
Method encode Encode an outgoing envelope once for direct send or broadcast reuse.
Class Variable __slots__ Declare the instance attribute slots reserved by this class.
Instance Variable _decoder Decoder produced by codec.Decoder.
Instance Variable _encoder Encoder produced by codec.Encoder.
Instance Variable _max_message_size Maximum incoming UTF-8 or binary byte length.
Instance Variable name json for text frames or msgpack for binary frames.
def __init__(self, name: str = 'json', *, max_message_size: int = _DEFAULT_MESSAGE_LIMIT): (source)

Prepare reusable msgspec codecs without connection or task ownership.

Parameters
name:str, optionaljson for text frames or msgpack for binary frames.
max_message_size:int, optionalMaximum incoming UTF-8 or binary byte length.
Returns
NonePrepare the selected protocol codec.
Raises
ValueErrorIf the codec is unknown or the message limit is not a positive, nonboolean integer.
def decode(self, message: WebSocketMessage) -> ClientMessage: (source)

Decode and validate one client envelope from a complete socket message.

Parameters
message:orionis.http.WebSocketMessageText JSON or binary MessagePack message selected by the route.
Returns
orionis.realtime.protocol.ClientMessageStrict typed request, completion, cancellation or ping/pong.
Raises
orionis.realtime.errors.ProtocolErrorIf frame kind, size, fields or structural limits are invalid.
def encode(self, message: object) -> str | bytes: (source)

Encode an outgoing envelope once for direct send or broadcast reuse.

Parameters
message:objectFramework-owned envelope containing a serializable result or event.
Returns
str | bytesText JSON or binary MessagePack payload.
Raises
TypeErrorIf an application result cannot be encoded.
__slots__: tuple[str, ...] = (source)

Declare the instance attribute slots reserved by this class.

_decoder = (source)

Decoder produced by codec.Decoder.

_encoder = (source)

Encoder produced by codec.Encoder.

_max_message_size = (source)

Maximum incoming UTF-8 or binary byte length.

json for text frames or msgpack for binary frames.