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.
Configure the container and serve requests within one worker event loop.
| Async Function | _asgi |
Dispatch ASGI body messages and cancel the handler on disconnect. |
| Async Function | _await |
Await an HTTP handler and clean up its disconnect monitor. |
| Function | _create |
Schedule an HTTP handler through the event loop's task factory. |
| Async Function | _monitor |
Admit a disconnect monitor or roll back the already admitted handler. |
| Function | _parse |
Split a dot-notated configuration key into immutable path components. |
| Function | _retire |
Retire a shared runtime owner under the caller's lifecycle lock. |
| Async Function | _rsgi |
Cancel the RSGI handler when the client disconnects. |
| Constant | _ASGI |
Asgi body queue size value used by application. |
| Constant | _CONFIG |
Config key cache size value used by application. |
| Constant | _CORE |
Core paths path used by application. |
| Constant | _CWD |
Cwd used by application. |
| Constant | _ERR |
Application configuration is not initialized. Please call create() first.. |
| Constant | _HEADLESS |
Owner retaining failure reporting after explicit headless boot. |
| Constant | _HTTP |
Owner retaining failure reporting for the HTTP server lifetime. |
| Constant | _MAINTENANCE |
Maintenance refresh ns value used by application. |
| Constant | _ROUTER |
orionis.support.facades. |
| Constant | _SENTINEL |
Sentinel distinguishing sentinel from ordinary values. |
Callable[ [], Awaitable[ dict[ str, Any]]], request_queue: asyncio.Queue, handler_task: asyncio.Task) -> bool:
(source)
¶
Dispatch ASGI body messages and cancel the handler on disconnect.
Pause receive calls while the bounded queue is full. Cancel the handler before propagating a receive-channel failure.
| Parameters | |
receive:collections.abc.Callable | Asynchronous callable yielding ASGI request messages. |
requestasyncio.Queue | Bounded message queue consumed by the handler. |
handlerasyncio.Task | Handler task to cancel when the client disconnects. |
| Returns | |
bool | Whether the disconnect message requested handler cancellation. |
asyncio.Task, disconnect_task: asyncio.Task[ bool], transport: str | None = None) -> Any:
(source)
¶
Await an HTTP handler and clean up its disconnect monitor.
| Parameters | |
handlerasyncio.Task | Task executing the kernel handler. |
disconnectasyncio.Task[bool] | Monitor indicating whether it requested disconnect cancellation. |
transport:str | None, optional | Transport identifier included in failure-reporting metadata. |
| Returns | |
typing.Any | Handler result, or None after disconnect-driven cancellation. |
| Raises | |
asyncio.CancelledError | If the caller or handler is cancelled independently of a disconnect. |
Exception | If the handler or disconnect monitor fails. |
asyncio.AbstractEventLoop, coroutine: Coroutine) -> asyncio.Task:
(source)
¶
Schedule an HTTP handler through the event loop's task factory.
| Parameters | |
loop:asyncio.AbstractEventLoop | Event loop serving the request. |
coroutine:collections.abc.Coroutine | Handler coroutine to schedule. |
| Returns | |
asyncio.Task | Scheduled handler, started eagerly only on a native loop without a custom task factory. |
asyncio.AbstractEventLoop, handler_task: asyncio.Task, monitor: Coroutine, transport: str) -> Any:
(source)
¶
Admit a disconnect monitor or roll back the already admitted handler.
| Parameters | |
loop:asyncio.AbstractEventLoop | Loop owning both request tasks. |
handlerasyncio.Task | Already admitted kernel handler. |
monitor:collections.abc.Coroutine | Disconnect monitor awaiting admission. |
transport:str | Transport identifier for cleanup diagnostics. |
| Returns | |
typing.Any | Handler result after normal monitor admission. |
| Raises | |
BaseException | Original admission or request failure after owned cleanup. |
FailureRuntime | None, owner: object | None) -> bool:
(source)
¶
Retire a shared runtime owner under the caller's lifecycle lock.
| Parameters | |
runtime:orionis.failure.runtime.FailureRuntime or None | Failure runtime to inspect, or None when reporting is unavailable. |
owner:object or None | Ownership token to release, or None to leave ownership unchanged. |
| Returns | |
bool | Whether shared resources must remain available to another owner. |
HTTPProtocol, handler_task: asyncio.Task) -> bool:
(source)
¶
Cancel the RSGI handler when the client disconnects.
| Parameters | |
protocol:granian.rsgi.HTTPProtocol | Protocol exposing the client-disconnect awaitable. |
handlerasyncio.Task | Handler task associated with the connection. |
| Returns | |
bool | Whether the disconnect requested handler cancellation. |
Application configuration is not initialized. Please call create() first..
| Value |
|