Skip to content

streaming

Functions:

decode_async_byte_stream async

decode_async_byte_stream(
    decoder: IncrementalDecoder,
    stream: AsyncIterable[bytes],
) -> AsyncIterator[str]

Convert a stream of bytes to a stream of UTF-8 strings - yields empty string on EOF.

write_async_byte_stream_into async

write_async_byte_stream_into(
    stream: AsyncIterable[bytes],
    buffer: IO[bytes],
    *,
    min_size: int
) -> int | None

Write at least min_size bytes into the buffer and return the number of bytes written.