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.

class documentation

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 _drainOversizedFrame 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 _reportFailure Claim and observe any unread input failure once.
Method _takeFailure 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_lock 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.
def __init__(self, stream: BinaryIO, limit: int, *, runtime: FailureRuntime | None = None): (source)

Start a daemon reader with bounded delivery to the running event loop.

Parameters
stream:typing.BinaryIOBinary input stream supporting bounded readline calls.
limit:intFrame-size threshold; each read requests up to limit + 2 bytes.
runtime:orionis.failure.runtime.FailureRuntime or None, optionalRuntime retained for unread failures; use the current runtime if None.
Returns
NoneCapture the running loop and start the reader's daemon thread.
Raises
RuntimeErrorIf no event loop is running in the calling thread.
def _drainOversizedFrame(self) -> bool: (source)

Discard the unread remainder of an oversized input frame.

Returns
boolTrue when draining completes; False on shutdown or an empty read. Forward an empty read as the end-of-input marker.
def _offer(self, item: bytes | Exception) -> bool: (source)

Offer one input item with backpressure on the reader's daemon thread.

Parameters
item:bytes | ExceptionInput chunk, EOF marker b"", or read exception to deliver.
Returns
boolTrue if the put completes and the reader is still open; False if delivery stops, is cancelled, or cannot be scheduled.
def _read(self): (source)

Read bounded input chunks and discard oversized frame remainders.

Forward read errors to the asynchronous consumer, or observe them if shutdown prevents delivery.

Returns
NoneFinish on end of input, shutdown, or a read failure.
def _reportFailure(self): (source)

Claim and observe any unread input failure once.

Returns
NoneSubmit a claimed failure with stdio metadata, or do nothing when no failure remains.
def _takeFailure(self) -> Exception | None: (source)

Claim and clear the pending read failure atomically.

Returns
Exception or NoneUnread exception removed from shared state, or None when none is pending.
def close(self): (source)

Stop input delivery without waiting for a blocked operating-system read.

Do not close the input stream or join the daemon thread.

Returns
NoneMark the reader closed, observe unread failures, and cancel a pending queue put.
async def readline(self) -> bytes: (source)

Await the next bounded input chunk or propagate a queued read failure.

Returns
bytesNext queued bytes, including any newline, or b"" for end of input.
Raises
ExceptionIf the reader queued an input-stream failure.
asyncio.CancelledErrorIf the coroutine is cancelled while waiting for input.
__slots__: tuple[str, ...] = (source)

Declare the instance attribute slots reserved by this class.

Whether this resource has completed its close lifecycle.

Read failure awaiting either delivery or shutdown observation.

_failure_lock = (source)

Transfer error ownership once between the daemon and event loop.

Value supplied for limit.

Loop produced by asyncio.get_running_loop.

Work that has been admitted and is awaiting completion.

Name of the queue receiving or storing the job.

_runtime = (source)

Runtime retained for failures after reader cancellation.

Value supplied for stream.