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
Provide storage operations.
Includes read_chunks, iterate_chunks, spool_stream.
| Async Function | _close |
Drain one owned resource close without replacing an active failure. |
| Async Function | iterate |
Batch SDK iterator advances with bounded read-ahead and deterministic close. |
| Async Function | read |
Read bounded batches while preserving logical chunks and first-byte latency. |
| Async Function | spool |
Buffer an async upload once for the cloud drivers. |
| Constant | READ |
Read buffer size used by buffering. |
Drain one owned resource close without replacing an active failure.
| Parameters | |
close:collections.abc.Callable | Synchronous close callback for an owned handle or SDK iterator. |
primary:BaseException or None | Error already propagating from the stream, including control signals. |
| Returns | |
None | No return value. |
| Raises | |
Exception | If cleanup fails without an earlier stream failure. |
asyncio.CancelledError | If the caller is cancelled, after the close completes. |
Batch SDK iterator advances with bounded read-ahead and deterministic close.
| Parameters | |
opener:collections.abc.Callable[[], collections.abc.Iterator[bytes]] | Synchronous factory for a request-owned SDK iterator. |
| Yields | |
bytes | Original SDK chunks. A batch holds at most sixteen chunks and stops when it reaches 1 MiB, so memory is bounded by 1 MiB plus one SDK chunk. A cleanup failure does not replace the iterator's original failure. |
async def read_chunks(opener:
Callable[ [], BinaryIO], chunk_size: int, *, buffer_size: int = READ_BUFFER_SIZE) -> AsyncIterator[ bytes]:
(source)
¶
Read bounded batches while preserving logical chunks and first-byte latency.
| Parameters | |
opener:collections.abc.Callable[[], typing.BinaryIO] | Factory for a handle owned exclusively by this iterator. |
chunkint | Maximum bytes yielded per logical chunk. |
bufferint | Read-ahead budget, rounded down to a whole number of logical chunks. At least one chunk is read. No producer runs while the consumer pauses. |
| Yields | |
bytes | File content in order. Cancellation drains the current read before close. Cleanup failures are observed separately when a read already failed. |
Buffer an async upload once for the cloud drivers.
Notes
Cancellation drains native opening, writing, and seeking before cleanup. Cleanup failures do not replace the producer or buffer failure.
| Parameters | |
stream:collections.abc.AsyncIterable[bytes] | Asynchronous byte-chunk producer. |
maxint | Positive maximum in-memory bytes before the buffer spills to disk. |
| Returns | |
typing.BinaryIO | Rewound temporary buffer owned and closed by the uploading driver. |
| Raises | |
ValueError | If max_size is not a positive integer or is a boolean. |