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 RSGIResponseAdapter(ResponseAdapter): (source)
Undocumented
| Method | __ensure |
Add content-length to headers if absent, reflecting the body size. |
| Method | __send |
Send a file or the byte interval selected by the request. |
| Async Method | __send |
Send HEAD metadata without starting an event producer. |
| Async Method | __send |
Deliver an ordinary stream or observe disconnects for an event stream. |
| Async Method | __send |
Send and close a stream through the existing RSGI transport. |
| Async Method | __wait |
Await Granian's supported HTTP client disconnect notification. |
| Async Method | send |
Send the HTTP response using the appropriate protocol adapter. |
| Class Variable | __slots__ |
Undocumented |
def __sendFile(self, adapter:
TransportAdapter, response: FileResponse, protocol: HTTPProtocol, status: int, headers: list[ tuple[ str, str]]):
(source)
¶
Send a file or the byte interval selected by the request.
| Parameters | |
adapter:TransportAdapter | Request headers used to select the file range. |
response:FileResponse | File metadata and source path. |
protocol:HTTPProtocol | RSGI response writer. |
status:int | HTTP status for a complete file. |
headers:list[tuple[str, str]] | Response headers for this request. |
| Returns | |
None | The file response is handed to the protocol. |
async def __sendHead(self, response:
Response, protocol: HTTPProtocol, status: int, headers: list[ tuple[ str, str]]):
(source)
¶
Send HEAD metadata without starting an event producer.
| Parameters | |
response:Response | Response whose metadata is sent. |
protocol:HTTPProtocol | RSGI response writer. |
status:int | Response status code. |
headers:list[tuple[str, str]] | Response headers. |
| Returns | |
None | Close an unstarted event stream after sending the empty response. |
async def __sendResponseStream(self, response:
Response, protocol: HTTPProtocol, status: int, headers: list[ tuple[ str, str]]) -> bool:
(source)
¶
Deliver an ordinary stream or observe disconnects for an event stream.
| Parameters | |
response:Response | Response owning the selected stream. |
protocol:HTTPProtocol | RSGI response writer and disconnect notifier. |
status:int | Response status code. |
headers:list[tuple[str, str]] | Serialized response headers. |
| Returns | |
bool | Whether delivery and cleanup completed before a client disconnect. |
async def __sendStream(self, iterator:
AsyncIterator[ bytes], protocol: HTTPProtocol, status: int, headers: list[ tuple[ str, str]]):
(source)
¶
Send and close a stream through the existing RSGI transport.
| Parameters | |
iterator:AsyncIterator[bytes] | Owned iterator, closed even when stream creation fails. |
protocol:HTTPProtocol | RSGI response protocol. |
status:int | Response status code. |
headers:list[tuple[str, str]] | Response headers. |
| Returns | |
None | Return after all bytes have been sent and cleanup succeeds. |
Await Granian's supported HTTP client disconnect notification.
| Parameters | |
protocol:HTTPProtocol | RSGI protocol exposing client_disconnect(). |
| Returns | |
None | Return when the client connection closes. |
async def send(self, adapter:
TransportAdapter, response: Response, protocol: HTTPProtocol):
(source)
¶
Send the HTTP response using the appropriate protocol adapter.
| Parameters | |
adapter:TransportAdapter | Transport adapter containing request information. |
response:Response | Response object to be sent back to the client. |
protocol:HTTPProtocol | Protocol instance used to send the response. |
| Returns | |
None | Sends the response via protocol and returns nothing. |
| Raises | |
BaseException | Propagate metadata or delivery failures after closing an owned SSE source. |