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

Undocumented

Async Function _cancel_tasks Cancel and join both owned tasks without abandoning asynchronous cleanup.
Async Function _finish_cancelled_cleanup Join owned cleanup after cancellation and retain its failure cause.
Function _raise_task_errors Propagate real sender and watcher failures after both tasks finish.
Function _record_completion Record the first completed future in event-loop callback order.
Async Function await_cleanup Await owned cleanup before propagating cancellation to its caller.
Async Function close_stream Close an iterator without letting sibling cancellation erase a failure.
Async Function send_until_disconnect Race a stream delivery against the transport's disconnect notification.
async def _cancel_tasks(tasks: tuple[Task[None], Task[None]]): (source)

Cancel and join both owned tasks without abandoning asynchronous cleanup.

Parameters
tasks:tuple[Task[None], Task[None]]Sender and disconnect watcher owned by one response.
Returns
NoneFinish both tasks before propagating their errors or cancellation.
async def _finish_cancelled_cleanup(pending: Future[T], ready: Future[Future[T]], cancellation: asyncio.CancelledError): (source)

Join owned cleanup after cancellation and retain its failure cause.

Parameters
pending:Future[T]Cleanup operation which must finish before its owner returns.
ready:Future[Future[T]]Completion notification carrying no cleanup exception.
cancellation:asyncio.CancelledErrorCancellation that the owner will re-raise after cleanup succeeds.
Returns
NoneFinish cleanup while deferring additional cancellation requests.
Raises
BaseExceptionIf cleanup fails, chain its error to the original cancellation.
def _raise_task_errors(results: list[BaseException | None]): (source)

Propagate real sender and watcher failures after both tasks finish.

Parameters
results:list[BaseException | None]Outcomes collected from both owned response tasks.
Returns
NoneReturn when both tasks succeeded or were cancelled.
Raises
BaseExceptionPreserve one failure or group simultaneous failures.
def _record_completion(first: Future[Future[T]], completed: Future[T]): (source)

Record the first completed future in event-loop callback order.

Parameters
first:Future[Future[T]]Completion notification awaited by the stream coordinator or cleanup.
completed:Future[T]Operation whose completion triggered this callback.
Returns
NonePreserve the first completion without changing a cancelled result.
async def await_cleanup(pending: Future[T]) -> T: (source)

Await owned cleanup before propagating cancellation to its caller.

Parameters
pending:Future[T]Cleanup operation protected from cancellation of its owner.
Returns
TCompleted cleanup result when the owner was not cancelled.
Raises
BaseExceptionPropagate cleanup failure, or cancellation after successful cleanup.
async def close_stream(iterator: AsyncIterable[bytes] | None, failure: BaseException | None): (source)

Close an iterator without letting sibling cancellation erase a failure.

Parameters
iterator:AsyncIterable[bytes] | NoneOwned source whose optional asynchronous close must be awaited, if present.
failure:BaseException | NoneProducer or transport failure already propagating through cleanup.
Returns
NoneFinish cleanup, retaining a real delivery error if cancellation races it.
async def send_until_disconnect(sending: Coroutine[None, None, None], disconnected: Coroutine[None, None, None]) -> bool: (source)

Race a stream delivery against the transport's disconnect notification.

Parameters
sending:Coroutine[None, None, None]Delivery operation, including iterator cleanup and final framing.
disconnected:Coroutine[None, None, None]Operation returning when the client disconnects.
Returns
boolWhether delivery completed before the disconnect watcher.
Raises
BaseExceptionPropagate delivery, notification, cleanup errors or request cancellation.