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
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 | abort |
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 | inherit |
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. |
Initialize a process-local index and execution-context binding.
| Returns | |
None | Prepare an empty loop index and an initially unbound context. |
Return the state for the current process and event loop.
| Returns | |
_LoopState | Process-local state of the running event loop. |
Roll back a failed ASGI event before sending its failure response.
| Returns | |
None | Finish the bound HTTP owner's cleanup before reporting failure. |
Bind this worker's HTTP owner for the incoming dispatch.
| Returns | |
contextvars.Token | Enter this token immediately to restore the previous owner on exit. |
Pass the headless lease to children spawned after a successful boot.
| Returns | |
None | Bind 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 | |
maxint | Maximum simultaneous outbound operations. |
maxint | Maximum requests waiting for admission. |
maxint | Maximum number of physical connections. |
| Returns | |
Reservation | Slot reserved for the pending exchange. |
Remove an idle loop without retaining closed test or worker loops.
| Parameters | |
state:_LoopState | Admission counters and generation for the owning loop. |
| Returns | |
None | Drop the index entry once the loop has no outstanding resources. |