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 |
Cancel and join both owned tasks without abandoning asynchronous cleanup. |
| Async Function | _finish |
Join owned cleanup after cancellation and retain its failure cause. |
| Function | _raise |
Propagate real sender and watcher failures after both tasks finish. |
| Function | _record |
Record the first completed future in event-loop callback order. |
| Async Function | await |
Await owned cleanup before propagating cancellation to its caller. |
| Async Function | close |
Close an iterator without letting sibling cancellation erase a failure. |
| Async Function | send |
Race a stream delivery against the transport's disconnect notification. |
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.CancelledError | Cancellation that the owner will re-raise after cleanup succeeds. |
| Returns | |
None | Finish cleanup while deferring additional cancellation requests. |
| Raises | |
BaseException | If cleanup fails, chain its error to the original cancellation. |
Propagate real sender and watcher failures after both tasks finish.
| Parameters | |
results:list[BaseException | None] | Outcomes collected from both owned response tasks. |
| Returns | |
None | Return when both tasks succeeded or were cancelled. |
| Raises | |
BaseException | Preserve one failure or group simultaneous failures. |
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 | |
None | Preserve the first completion without changing a cancelled result. |
Await owned cleanup before propagating cancellation to its caller.
| Parameters | |
pending:Future[T] | Cleanup operation protected from cancellation of its owner. |
| Returns | |
T | Completed cleanup result when the owner was not cancelled. |
| Raises | |
BaseException | Propagate 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] | None | Owned source whose optional asynchronous close must be awaited, if present. |
failure:BaseException | None | Producer or transport failure already propagating through cleanup. |
| Returns | |
None | Finish 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 | |
bool | Whether delivery completed before the disconnect watcher. |
| Raises | |
BaseException | Propagate delivery, notification, cleanup errors or request cancellation. |