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

Own a lazy thread pool with bounded running and queued work.

Admission is process-wide per instance, including across event loops. Cancellation waits for running native work; queued work is cancelled.

Method __init__ Configure a lazy worker pool.
Async Method aclose Close without blocking the event loop.
Method close Drain accepted work and release the pool's threads.
Async Method run Execute a synchronous callable with copied context and bounded admission.
Instance Variable _capacity Synchronization primitive controlling access to capacity.
Instance Variable _closed Whether this resource has completed its close lifecycle.
Instance Variable _lock Lock protecting concurrent access to shared state.
Instance Variable _name Prefix used for worker thread names.
Instance Variable _pool Thread pool used to execute admitted blocking operations.
Instance Variable _workers Maximum simultaneous native calls.
def __init__(self: Self, max_workers: int = 4, *, max_pending: int = 32, name: str = 'orionis-worker'): (source)

Configure a lazy worker pool.

Parameters
max_workers:intMaximum simultaneous native calls.
max_pending:intMaximum additional queued calls; overload raises WorkQueueFullError.
name:strPrefix used for worker thread names.
Returns
NoneComplete the operation without returning a value.
async def aclose(self: Self): (source)

Close without blocking the event loop.

Wait for accepted work to finish and join the pool's threads.

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

Drain accepted work and release the pool's threads.

Reject further submissions once closing starts.

Returns
NoneNo return value.
async def run(self: Self, callback: Callable[..., T], /, *args: object, **kwargs: object) -> T: (source)

Execute a synchronous callable with copied context and bounded admission.

Parameters
callback:collections.abc.Callable[..., T]Synchronous operation with thread-safe dependencies.
*args:objectPositional callback arguments.
**kwargs:objectKeyword callback arguments.
Returns
TResult from the worker thread.
_capacity = (source)

Synchronization primitive controlling access to capacity.

Whether this resource has completed its close lifecycle.

Lock protecting concurrent access to shared state.

Prefix used for worker thread names.

Thread pool used to execute admitted blocking operations.

_workers = (source)

Maximum simultaneous native calls.