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 _MiddlewarePipeline: (source)
Constructor: _MiddlewarePipeline(instances, request, terminal, terminal_args)
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__ |
Undocumented |
| Instance Variable | _called |
Undocumented |
| Instance Variable | _instances |
Undocumented |
| Instance Variable | _n |
Undocumented |
| Instance Variable | _request |
Undocumented |
| Instance Variable | _terminal |
Undocumented |
| Instance Variable | _terminal |
Undocumented |
Invoke the layer at a fixed depth with its own continuation.
| Parameters | |
depth:int | Position of the middleware or terminal to execute. |
| Returns | |
T | Result returned by this middleware and its descendants. |
Start the middleware stack once for this request.
| Returns | |
T | Result produced by the middleware stack or terminal. |
| Raises | |
RuntimeError | If 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:tuple | Ordered tuple of pre-built middleware instances. |
request:Request | Incoming HTTP request forwarded to each layer. |
terminal:Callable[..., Awaitable[Response]] | Async callable invoked after all middleware layers have run. |
terminaltuple, optional | Positional arguments forwarded to the terminal callable. |
| Returns | |
None | Undocumented |