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

Middleware pipeline with request-local execution state.

A single instance encapsulates the execution state for one middleware stack invocation. Each layer receives a fixed continuation so concurrent invocations cannot change the depth observed by another middleware.

Async Method __advance Invoke the layer at a fixed depth with its own continuation.
Async Method __call__ Start the middleware stack once for this request.
Method __init__ Store the middleware stack and terminal callable for one request.
Class Variable __slots__ Declare the instance attribute slots reserved by this class.
Instance Variable _called Called flag used by _MiddlewarePipeline.
Instance Variable _instances Ordered tuple of pre-built middleware instances.
Instance Variable _n N produced by len.
Instance Variable _request Incoming HTTP request forwarded to each layer.
Instance Variable _terminal Async callable invoked after all middleware layers have run.
Instance Variable _terminal_args Positional arguments forwarded to the terminal callable.
async def __advance(self, depth: int) -> T: (source)

Invoke the layer at a fixed depth with its own continuation.

Parameters
depth:intPosition of the middleware or terminal to execute.
Returns
TResult returned by this middleware and its descendants.
async def __call__(self) -> T: (source)

Start the middleware stack once for this request.

Returns
TResult produced by the middleware stack or terminal.
Raises
RuntimeErrorIf this pipeline has already started.
def __init__(self, instances: tuple, request: Request | WebSocket, terminal: Callable[..., Awaitable[T]], terminal_args: tuple = ()): (source)

Store the middleware stack and terminal callable for one request.

Parameters
instances:tupleOrdered tuple of pre-built middleware instances.
request:orionis.http.RequestIncoming HTTP request forwarded to each layer.
terminal:Callable[..., Awaitable[Response]]Async callable invoked after all middleware layers have run.
terminal_args:tuple, optionalPositional arguments forwarded to the terminal callable.
Returns
NoneStore the middleware stack and terminal callable for one request.
__slots__: tuple[str, ...] = (source)

Declare the instance attribute slots reserved by this class.

Called flag used by _MiddlewarePipeline.

_instances = (source)

Ordered tuple of pre-built middleware instances.

N produced by len.

_request = (source)

Incoming HTTP request forwarded to each layer.

_terminal = (source)

Async callable invoked after all middleware layers have run.

_terminal_args = (source)

Positional arguments forwarded to the terminal callable.