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
Join source cleanup before propagating delivery errors or cancellation.
| Method | __aiter__ |
Return this stream as its single-consumer asynchronous iterator. |
| Async Method | __anext__ |
Return the next source item and close on exhaustion or failure. |
| Method | __init__ |
Take lazy ownership of a synchronous or asynchronous iterator. |
| Async Method | _close |
Share cleanup while transferring its primary incident to the owned task. |
| Async Method | _close |
Close the source before releasing its nested owner. |
| Async Method | aclose |
Await one shared cleanup task across repeated close calls. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | _cleanup |
Cleanup task shared by callers closing the owned stream. |
| Instance Variable | _closed |
Whether this resource has completed its close lifecycle. |
| Instance Variable | _owner |
Value supplied for owner. |
| Instance Variable | _source |
Source whose values or lifecycle are consumed by this operation. |
Return this stream as its single-consumer asynchronous iterator.
| Returns | |
collections.abc.AsyncIterator[T] | This stream, without creating or advancing another iterator. |
Return the next source item and close on exhaustion or failure.
| Returns | |
T | Next value from the owned synchronous or asynchronous iterator. |
| Raises | |
StopAsyncIteration | If the stream is closed or exhausted and cleanup succeeds. |
BaseException | If iteration or cleanup fails. Preserve an iteration failure when cleanup also fails; surface cleanup errors after normal exhaustion. Genuine caller cancellation propagates after cleanup is drained. |
def __init__(self, source:
AsyncIterator[ T] | Iterator[ T], owner: OwnedStream[ object] | None = None):
(source)
¶
Take lazy ownership of a synchronous or asynchronous iterator.
| Parameters | |
source:AsyncIterator[T] or Iterator[T] | Iterator whose values and cleanup lifecycle this stream owns. |
owner:orionis.mcp.streams.OwnedStream[object] or None, optional | Nested owner to close after this source, even if iteration never begins. |
| Returns | |
None | Store source and owner without advancing either iterator. |
Close the source before releasing its nested owner.
Prefer aclose over close and release the owner even when source cleanup fails or iteration never started.
| Parameters | |
parentstr or None, optional | Producer incident transferred without changing exception chains. |
| Returns | |
None | Complete available source hooks and nested-owner cleanup. |
| Raises | |
BaseException | If either cleanup fails; retain the source failure as primary when both source and owner cleanup fail. |
overrides
orionis.mcp.streams.AsyncClosable.acloseAwait one shared cleanup task across repeated close calls.
| Returns | |
None | Finish source and nested-owner cleanup without starting another task. |
| Raises | |
BaseException | If cleanup fails, or if caller cancellation must propagate after cleanup has finished. |