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.

module documentation

Configure the container and serve requests within one worker event loop.

Async Function _asgi_receive_dispatcher Dispatch ASGI body messages and cancel the handler on disconnect.
Async Function _await_http_tasks Await an HTTP handler and clean up its disconnect monitor.
Function _create_http_handler_task Schedule an HTTP handler through the event loop's task factory.
Async Function _monitor_http_handler Admit a disconnect monitor or roll back the already admitted handler.
Function _parse_config_key Split a dot-notated configuration key into immutable path components.
Function _retire_shared_runtime Retire a shared runtime owner under the caller's lifecycle lock.
Async Function _rsgi_disconnect_watcher Cancel the RSGI handler when the client disconnects.
Constant _ASGI_BODY_QUEUE_SIZE Asgi body queue size value used by application.
Constant _CONFIG_KEY_CACHE_SIZE Config key cache size value used by application.
Constant _CORE_PATHS_PATH Core paths path used by application.
Constant _CWD Cwd used by application.
Constant _ERR_NOT_CONFIGURED Application configuration is not initialized. Please call create() first..
Constant _HEADLESS_FAILURE_OWNER Owner retaining failure reporting after explicit headless boot.
Constant _HTTP_FAILURE_OWNER Owner retaining failure reporting for the HTTP server lifetime.
Constant _MAINTENANCE_REFRESH_NS Maintenance refresh ns value used by application.
Constant _ROUTER_FACADE_MODULE orionis.support.facades.
Constant _SENTINEL Sentinel distinguishing sentinel from ordinary values.
async def _asgi_receive_dispatcher(receive: 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.CallableAsynchronous callable yielding ASGI request messages.
request_queue:asyncio.QueueBounded message queue consumed by the handler.
handler_task:asyncio.TaskHandler task to cancel when the client disconnects.
Returns
boolWhether the disconnect message requested handler cancellation.
async def _await_http_tasks(handler_task: asyncio.Task, disconnect_task: asyncio.Task[bool], transport: str | None = None) -> Any: (source)

Await an HTTP handler and clean up its disconnect monitor.

Parameters
handler_task:asyncio.TaskTask executing the kernel handler.
disconnect_task:asyncio.Task[bool]Monitor indicating whether it requested disconnect cancellation.
transport:str | None, optionalTransport identifier included in failure-reporting metadata.
Returns
typing.AnyHandler result, or None after disconnect-driven cancellation.
Raises
asyncio.CancelledErrorIf the caller or handler is cancelled independently of a disconnect.
ExceptionIf the handler or disconnect monitor fails.
def _create_http_handler_task(loop: asyncio.AbstractEventLoop, coroutine: Coroutine) -> asyncio.Task: (source)

Schedule an HTTP handler through the event loop's task factory.

Parameters
loop:asyncio.AbstractEventLoopEvent loop serving the request.
coroutine:collections.abc.CoroutineHandler coroutine to schedule.
Returns
asyncio.TaskScheduled handler, started eagerly only on a native loop without a custom task factory.
async def _monitor_http_handler(loop: 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.AbstractEventLoopLoop owning both request tasks.
handler_task:asyncio.TaskAlready admitted kernel handler.
monitor:collections.abc.CoroutineDisconnect monitor awaiting admission.
transport:strTransport identifier for cleanup diagnostics.
Returns
typing.AnyHandler result after normal monitor admission.
Raises
BaseExceptionOriginal admission or request failure after owned cleanup.
def _parse_config_key(key: str) -> tuple[str, ...]: (source)

Split a dot-notated configuration key into immutable path components.

Parameters
key:strValidated configuration key, including any empty path segments.
Returns
tuple of strCached components independent of application configuration values.
def _retire_shared_runtime(runtime: 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 NoneFailure runtime to inspect, or None when reporting is unavailable.
owner:object or NoneOwnership token to release, or None to leave ownership unchanged.
Returns
boolWhether shared resources must remain available to another owner.
async def _rsgi_disconnect_watcher(protocol: HTTPProtocol, handler_task: asyncio.Task) -> bool: (source)

Cancel the RSGI handler when the client disconnects.

Parameters
protocol:granian.rsgi.HTTPProtocolProtocol exposing the client-disconnect awaitable.
handler_task:asyncio.TaskHandler task associated with the connection.
Returns
boolWhether the disconnect requested handler cancellation.
_ASGI_BODY_QUEUE_SIZE: int = (source)

Asgi body queue size value used by application.

Value
8
_CONFIG_KEY_CACHE_SIZE: int = (source)

Config key cache size value used by application.

Value
256
_CORE_PATHS_PATH = (source)

Core paths path used by application.

Value
Path(__file__).with_name('core_paths.py').resolve()

Cwd used by application.

Value
Path.cwd()
_ERR_NOT_CONFIGURED: str = (source)

Application configuration is not initialized. Please call create() first..

Value
'Application configuration is not initialized. Please call create() first.'
_HEADLESS_FAILURE_OWNER = (source)

Owner retaining failure reporting after explicit headless boot.

Value
object()
_HTTP_FAILURE_OWNER = (source)

Owner retaining failure reporting for the HTTP server lifetime.

Value
object()
_MAINTENANCE_REFRESH_NS: int = (source)

Maintenance refresh ns value used by application.

Value
100000000
_ROUTER_FACADE_MODULE: str = (source)

orionis.support.facades.

Value
'orionis.support.facades'
_SENTINEL = (source)

Sentinel distinguishing sentinel from ordinary values.

Value
object()