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

class ServerSentEvent: (source)

View In Hierarchy

Represent one immutable UTF-8 server-sent event.

Parameters
dataText payload; serialize structured values explicitly before passing them.
eventSingle-line event name.
idSingle-line cursor without NUL characters.
retryNon-negative reconnection delay in milliseconds; booleans are rejected.
commentComment text, including manual heartbeat messages.
Method __post_init__ Validate field types and prevent single-line field injection.
Method _validateRetry Require a nonnegative integer for an explicitly supplied retry delay.
Method encode Encode the event as UTF-8 fields followed by one empty line.
Class Variable comment Undocumented
Class Variable data Undocumented
Class Variable event Undocumented
Class Variable id Undocumented
Class Variable retry Undocumented
def __post_init__(self): (source)

Validate field types and prevent single-line field injection.

Returns
NoneValidate immutable event fields before the event can be used.
Raises
TypeErrorIf text fields are not strings or retry is not a non-boolean integer.
ValueErrorIf retry is negative, event/id contain newlines, or id contains NUL.
def _validateRetry(self): (source)

Require a nonnegative integer for an explicitly supplied retry delay.

Returns
NoneAccept the retry delay without coercing it.
Raises
TypeErrorIf the retry delay is not a non-boolean integer.
ValueErrorIf the retry delay is negative.
def encode(self) -> bytes: (source)

Encode the event as UTF-8 fields followed by one empty line.

Returns
bytesSSE frame with CRLF/CR normalized to LF in multiline fields.
comment: str | None, optional = (source)

Undocumented

data: str | None, optional = (source)

Undocumented

event: str | None, optional = (source)

Undocumented

id: str | None, optional = (source)

Undocumented

retry: int | None, optional = (source)

Undocumented