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

class HttpRuntime: (source)

Constructor: HttpRuntime()

View In Hierarchy

Index independent transport lifetimes for one application.

Each process and event loop owns its own pool and admission state.

Method __init__ Initialize a process-local index and execution-context binding.
Method _state Return the state for the current process and event loop.
Async Method abortHttp Roll back a failed ASGI event before sending its failure response.
Method acquire Acquire a distinct command token or reuse a named worker lifetime.
Async Method close Release only this owner, draining the generation on final release.
Method dispatch Bind this worker's HTTP owner for the incoming dispatch.
Async Method ending Retain a named owner through shutdown hooks and release it afterwards.
Method inheritHeadless Pass the headless lease to children spawned after a successful boot.
Method reserve Limit queued and active work synchronously before copying a payload.
Method retire Remove an idle loop without retaining closed test or worker loops.
Async Method scope Bind an owner to the operation and close it on every exit.
Async Method starting Make the owner available during startup, rolling back on failure.
Instance Variable _bound Owner inherited by tasks created within the current lifecycle.
Instance Variable _loops States indexed by event loop in this process.
Instance Variable _pid Process identifier for the current event-loop index.
def __init__(self): (source)

Initialize a process-local index and execution-context binding.

Returns
NonePrepare an empty loop index and an initially unbound context.
def _state(self) -> _LoopState: (source)

Return the state for the current process and event loop.

Returns
_LoopStateProcess-local state of the running event loop.
async def abortHttp(self): (source)

Roll back a failed ASGI event before sending its failure response.

Returns
NoneFinish the bound HTTP owner's cleanup before reporting failure.
def acquire(self, kind: Kind) -> _Owner: (source)

Acquire a distinct command token or reuse a named worker lifetime.

Parameters
kind:KindFramework entry point acquiring the resource.
Returns
_OwnerOwnership token for the active generation.
async def close(self, owner: _Owner): (source)

Release only this owner, draining the generation on final release.

Parameters
owner:_OwnerApplication lifetime holding the pool, if present.
Returns
NoneFinish any drain started by the last owner before returning.
def dispatch(self) -> Token[_Owner | object | None]: (source)

Bind this worker's HTTP owner for the incoming dispatch.

Returns
contextvars.TokenEnter this token immediately to restore the previous owner on exit.
async def ending(self, kind: Kind) -> AsyncGenerator[bool]: (source)

Retain a named owner through shutdown hooks and release it afterwards.

Parameters
kind:KindFramework entry point acquiring the resource.
Yields
boolWhether shutdown hooks should run for this owner.
def inheritHeadless(self): (source)

Pass the headless lease to children spawned after a successful boot.

Returns
NoneBind the headless owner when the current context can inherit it.
def reserve(self, max_in_flight: int, max_pending: int, max_connections: int = 32) -> Reservation: (source)

Limit queued and active work synchronously before copying a payload.

Parameters
max_in_flight:intMaximum simultaneous outbound operations.
max_pending:intMaximum requests waiting for admission.
max_connections:intMaximum number of physical connections.
Returns
ReservationSlot reserved for the pending exchange.
def retire(self, state: _LoopState): (source)

Remove an idle loop without retaining closed test or worker loops.

Parameters
state:_LoopStateAdmission counters and generation for the owning loop.
Returns
NoneDrop the index entry once the loop has no outstanding resources.
async def scope(self, kind: Kind) -> AsyncGenerator[_Owner]: (source)

Bind an owner to the operation and close it on every exit.

Parameters
kind:KindFramework entry point acquiring the resource.
Yields
_OwnerOwnership token for the active generation.
async def starting(self, kind: Kind) -> AsyncGenerator[None]: (source)

Make the owner available during startup, rolling back on failure.

Parameters
kind:KindFramework entry point acquiring the resource.
Yields
NoneRun startup hooks with the acquired lifetime bound to the context.

Owner inherited by tasks created within the current lifecycle.

States indexed by event loop in this process.

Process identifier for the current event-loop index.