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.
Read at most one queued frame using an interruptible async queue boundary.
| Method | __init__ |
Start a daemon reader with bounded delivery to the running event loop. |
| Method | _drain |
Discard the unread remainder of an oversized input frame. |
| Method | _offer |
Offer one input item with backpressure on the reader's daemon thread. |
| Method | _read |
Read bounded input chunks and discard oversized frame remainders. |
| Method | _report |
Claim and observe any unread input failure once. |
| Method | _take |
Claim and clear the pending read failure atomically. |
| Method | close |
Stop input delivery without waiting for a blocked operating-system read. |
| Async Method | readline |
Await the next bounded input chunk or propagate a queued read failure. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | _closed |
Whether this resource has completed its close lifecycle. |
| Instance Variable | _failure |
Read failure awaiting either delivery or shutdown observation. |
| Instance Variable | _failure |
Transfer error ownership once between the daemon and event loop. |
| Instance Variable | _limit |
Value supplied for limit. |
| Instance Variable | _loop |
Loop produced by asyncio.get_running_loop. |
| Instance Variable | _pending |
Work that has been admitted and is awaiting completion. |
| Instance Variable | _queue |
Name of the queue receiving or storing the job. |
| Instance Variable | _runtime |
Runtime retained for failures after reader cancellation. |
| Instance Variable | _stream |
Value supplied for stream. |
BinaryIO, limit: int, *, runtime: FailureRuntime | None = None):
(source)
¶
Start a daemon reader with bounded delivery to the running event loop.
| Parameters | |
stream:typing.BinaryIO | Binary input stream supporting bounded readline calls. |
limit:int | Frame-size threshold; each read requests up to limit + 2 bytes. |
runtime:orionis.failure.runtime.FailureRuntime or None, optional | Runtime retained for unread failures; use the current runtime if None. |
| Returns | |
None | Capture the running loop and start the reader's daemon thread. |
| Raises | |
RuntimeError | If no event loop is running in the calling thread. |
Discard the unread remainder of an oversized input frame.
| Returns | |
bool | True when draining completes; False on shutdown or an empty read. Forward an empty read as the end-of-input marker. |
Offer one input item with backpressure on the reader's daemon thread.
| Parameters | |
item:bytes | Exception | Input chunk, EOF marker b"", or read exception to deliver. |
| Returns | |
bool | True if the put completes and the reader is still open; False if delivery stops, is cancelled, or cannot be scheduled. |
Read bounded input chunks and discard oversized frame remainders.
Forward read errors to the asynchronous consumer, or observe them if shutdown prevents delivery.
| Returns | |
None | Finish on end of input, shutdown, or a read failure. |
Claim and observe any unread input failure once.
| Returns | |
None | Submit a claimed failure with stdio metadata, or do nothing when no failure remains. |
Stop input delivery without waiting for a blocked operating-system read.
Do not close the input stream or join the daemon thread.
| Returns | |
None | Mark the reader closed, observe unread failures, and cancel a pending queue put. |
Await the next bounded input chunk or propagate a queued read failure.
| Returns | |
bytes | Next queued bytes, including any newline, or b"" for end of input. |
| Raises | |
Exception | If the reader queued an input-stream failure. |
asyncio.CancelledError | If the coroutine is cancelled while waiting for input. |