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)
Represent one immutable UTF-8 server-sent event.
| Parameters | |
| data | Text payload; serialize structured values explicitly before passing them. |
| event | Single-line event name. |
| id | Single-line cursor without NUL characters. |
| retry | Non-negative reconnection delay in milliseconds; booleans are rejected. |
| comment | Comment text, including manual heartbeat messages. |
| Method | __post |
Validate field types and prevent single-line field injection. |
| Method | _validate |
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 |
Validate field types and prevent single-line field injection.
| Returns | |
None | Validate immutable event fields before the event can be used. |
| Raises | |
TypeError | If text fields are not strings or retry is not a non-boolean integer. |
ValueError | If retry is negative, event/id contain newlines, or id contains NUL. |
Require a nonnegative integer for an explicitly supplied retry delay.
| Returns | |
None | Accept the retry delay without coercing it. |
| Raises | |
TypeError | If the retry delay is not a non-boolean integer. |
ValueError | If the retry delay is negative. |
Encode the event as UTF-8 fields followed by one empty line.
| Returns | |
bytes | SSE frame with CRLF/CR normalized to LF in multiline fields. |