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.

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.
Instance Variable comment Comment text, including manual heartbeat messages.
Instance Variable data Text payload; serialize structured values explicitly before passing them.
Instance Variable event Single-line event name.
Instance Variable id Single-line cursor without NUL characters.
Instance Variable retry Non-negative reconnection delay in milliseconds; booleans are rejected.
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)

Comment text, including manual heartbeat messages.

data: str | None, optional = (source)

Text payload; serialize structured values explicitly before passing them.

event: str | None, optional = (source)

Single-line event name.

id: str | None, optional = (source)

Single-line cursor without NUL characters.

retry: int | None, optional = (source)

Non-negative reconnection delay in milliseconds; booleans are rejected.