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 ThreadedWorker: (source)

Constructor: ThreadedWorker()

View In Hierarchy

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 _closedTask 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_task 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.
def __init__(self): (source)

Prepare a worker without starting a thread or opening a connection.

Returns
NoneNo return value.
def _closedTask(self, pending: asyncio.Task[None]): (source)

Release the completed coordinator and its copied execution context.

Parameters
pending:asyncio.Task[None]Shared shutdown task that has reached a terminal state.
Returns
NoneNo return value.
async def _shutdown(self): (source)

Drain logical operations before shutting down their reserved executor.

Returns
NoneNo return value.
async def close(self): (source)

Join this worker without blocking the event loop.

Returns
NoneNo return value.
Raises
asyncio.CancelledErrorOnly 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.
on_cancel:collections.abc.Callable[[T], None] | None, optionalDispose a resource produced after its caller was cancelled.
Returns
TCompleted operation result.
Raises
RuntimeErrorIf the worker has already been closed.
asyncio.CancelledErrorAfter blocking work and any required cancellation cleanup finish.
__slots__: tuple[str, ...] = (source)

Declare the instance attribute slots reserved by this class.

Shared shutdown operation while owned work is being drained.

Whether admission has closed, including while shutdown is pending.

_executor = (source)

Executor produced by ThreadPoolExecutor.

Completion notices including each operation's late-result cleanup.