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
Serialize one checked-out DBAPI connection on one worker thread.
Cancellation waits for blocking I/O to finish before releasing its connection. Operations on other checkouts use independent workers and remain concurrent. Closing rejects new work and joins both submitted operations and their cancellation cleanup; concurrent close callers share that completion.
| Method | __init__ |
Prepare a worker without starting a thread or opening a connection. |
| Method | _closed |
Release the completed coordinator and its copied execution context. |
| Async Method | _shutdown |
Drain logical operations before shutting down their reserved executor. |
| Async Method | close |
Join this worker without blocking the event loop. |
| Async Method | run |
Execute blocking work and settle it before propagating cancellation. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | _close |
Shared shutdown operation while owned work is being drained. |
| Instance Variable | _closed |
Whether admission has closed, including while shutdown is pending. |
| Instance Variable | _executor |
Executor produced by ThreadPoolExecutor. |
| Instance Variable | _pending |
Completion notices including each operation's late-result cleanup. |
Release the completed coordinator and its copied execution context.
| Parameters | |
pending:asyncio.Task[None] | Shared shutdown task that has reached a terminal state. |
| Returns | |
None | No return value. |
Join this worker without blocking the event loop.
| Returns | |
None | No return value. |
| Raises | |
asyncio.CancelledError | Only after executor shutdown has completed. |
async def run(self, operation:
Callable[ [], T], *, on_cancel: Callable[ [ T], None] | None = None) -> T:
(source)
¶
Execute blocking work and settle it before propagating cancellation.
| Parameters | |
operation:collections.abc.Callable[[], T] | Blocking operation owned by this connection. |
oncollections.abc.Callable[[T], None] | None, optional | Dispose a resource produced after its caller was cancelled. |
| Returns | |
T | Completed operation result. |
| Raises | |
RuntimeError | If the worker has already been closed. |
asyncio.CancelledError | After blocking work and any required cancellation cleanup finish. |