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

Adapt Granian's actual RSGI WebsocketProtocol and accepted transport.

Method __init__ Retain the pending server protocol.
Method _acceptedTransport Require the transport returned by a completed handshake.
Async Method accept Accept through Granian's argument-free handshake method.
Async Method close Close through Granian's default connection closure API.
Async Method receive Normalize Granian's close, bytes and string message kinds.
Async Method reject Reject the handshake using the actual HTTP status argument.
Async Method sendBytes Await Granian's binary write without buffering.
Async Method sendText Await Granian's text write without buffering.
Class Variable __slots__ Undocumented
Instance Variable _protocol Undocumented
Instance Variable _transport Undocumented
Property supportsCloseDetails Report the documented RSGI close-frame limitation.
def __init__(self, protocol: RSGIWebsocketProtocol): (source)

Retain the pending server protocol.

Parameters
protocol:WebsocketProtocolGranian's handshake and close interface.
Returns
NonePrepare a transport that will be bound during acceptance.
def _acceptedTransport(self) -> RSGIWebsocketTransport: (source)

Require the transport returned by a completed handshake.

Returns
RSGIWebsocketTransportGranian's active message transport.
Raises
RuntimeErrorIf called before acceptance completed.
async def accept(self, *, subprotocol: str | None = None, headers: Mapping[str, str] | None = None): (source)

Accept through Granian's argument-free handshake method.

Parameters
subprotocol:str | None, optionalUnsupported by this RSGI version.
headers:Mapping[str, str] | None, optionalUnsupported by this RSGI version.
Returns
NoneStore the returned accepted transport.
Raises
NotImplementedErrorIf unsupported handshake options are requested.
WebSocketDisconnectedIf the server reports an already closed connection.
async def close(self, code: int = 1000, reason: str = ''): (source)

Close through Granian's default connection closure API.

Parameters
code:int, optionalOnly normal closure is supported.
reason:str, optionalOnly the empty reason is supported.
Returns
NoneInvoke synchronous connection closure.
Raises
NotImplementedErrorIf a custom wire close code or reason is requested.
async def receive(self) -> WebSocketMessage: (source)

Normalize Granian's close, bytes and string message kinds.

Returns
WebSocketMessageMessage with unknown peer close details represented as code 1006.
Raises
RuntimeErrorIf the server supplies an invalid message kind or payload.
WebSocketDisconnectedIf the server reports a transport disconnection.
async def reject(self, status_code: int = 403): (source)

Reject the handshake using the actual HTTP status argument.

Parameters
status_code:int, optionalHTTP rejection status.
Returns
NoneInvoke Granian's synchronous close method.
async def sendBytes(self, data: bytes): (source)

Await Granian's binary write without buffering.

Parameters
data:bytesComplete binary message.
Returns
NoneFinish the server write.
Raises
WebSocketDisconnectedIf the peer has closed the transport.
async def sendText(self, data: str): (source)

Await Granian's text write without buffering.

Parameters
data:strComplete text message.
Returns
NoneFinish the server write.
Raises
WebSocketDisconnectedIf the peer has closed the transport.
_protocol = (source)

Undocumented

_transport: RSGIWebsocketTransport | None = (source)

Undocumented

supportsCloseDetails: bool = (source)

Report the documented RSGI close-frame limitation.

Returns
boolFalse because protocol.close(status) controls HTTP rejection.