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.

module documentation

Provide support operations.

Includes WorkQueueFullError, complete_on_cancel, BoundedExecutor, threaded.

Class BoundedExecutor Own a lazy thread pool with bounded running and queued work.
Exception WorkQueueFullError Signal that a bounded worker pool cannot admit another operation.
Async Function complete_on_cancel Wait for owned work before propagating caller cancellation.
Function threaded Opt a synchronous handler into bounded thread execution.
Constant _CALLBACK_WORKERS Callback workers used by concurrency.
async def complete_on_cancel(awaitable: Awaitable[T], *, on_cancel: Callable[[], object] | None = None) -> T: (source)

Wait for owned work before propagating caller cancellation.

Parameters
awaitable:collections.abc.Awaitable[T]Operation that must finish before its resources can be released.
on_cancel:collections.abc.Callable[[], object] | NoneOptional request to stop work that has not started yet.
Returns
TOperation result unless the caller was cancelled.
def threaded(callback: Callable[P, T]) -> Callable[P, Awaitable[T]]: (source)

Opt a synchronous handler into bounded thread execution.

Parameters
callback:collections.abc.Callable[P, T]Blocking synchronous function. Dependencies must support worker threads.
Returns
collections.abc.Callable[P, collections.abc.Awaitable[T]]Async wrapper preserving the signature used for dependency injection. Context variables propagate; CPU-bound Python still contends for the GIL.
_CALLBACK_WORKERS = (source)

Callback workers used by concurrency.

Value
BoundedExecutor(name='orionis-callback')