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 RSGIWebSocketTransport(IWebSocketTransport): (source)
Constructor: RSGIWebSocketTransport(protocol)
Adapt Granian's actual RSGI WebsocketProtocol and accepted transport.
| Method | __init__ |
Retain the pending server protocol. |
| Method | _accepted |
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 | send |
Await Granian's binary write without buffering. |
| Async Method | send |
Await Granian's text write without buffering. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | _protocol |
Undocumented |
| Instance Variable | _transport |
Undocumented |
| Property | supports |
Report the documented RSGI close-frame limitation. |
Retain the pending server protocol.
| Parameters | |
protocol:WebsocketProtocol | Granian's handshake and close interface. |
| Returns | |
None | Prepare a transport that will be bound during acceptance. |
Require the transport returned by a completed handshake.
| Returns | |
RSGIWebsocketTransport | Granian's active message transport. |
| Raises | |
RuntimeError | If 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, optional | Unsupported by this RSGI version. |
headers:Mapping[str, str] | None, optional | Unsupported by this RSGI version. |
| Returns | |
None | Store the returned accepted transport. |
| Raises | |
NotImplementedError | If unsupported handshake options are requested. |
WebSocketDisconnected | If the server reports an already closed connection. |
Close through Granian's default connection closure API.
| Parameters | |
code:int, optional | Only normal closure is supported. |
reason:str, optional | Only the empty reason is supported. |
| Returns | |
None | Invoke synchronous connection closure. |
| Raises | |
NotImplementedError | If a custom wire close code or reason is requested. |
Normalize Granian's close, bytes and string message kinds.
| Returns | |
WebSocketMessage | Message with unknown peer close details represented as code 1006. |
| Raises | |
RuntimeError | If the server supplies an invalid message kind or payload. |
WebSocketDisconnected | If the server reports a transport disconnection. |