bareutils.streaming
module bareutils.streaming ¶
Summary¶
Streaming
async function bareutils.streaming.bytes_reader ¶
Summary¶
Extracts the body body as bytes.
async bareutils.streaming.bytes_reader(
) -> bytes
body: AsyncIterable[bytes]
async generator function bareutils.streaming.bytes_writer ¶
Summary¶
Creates an asynchronous iterator from the supplied response body.
async bareutils.streaming.bytes_writer(
) -> AsyncIterable[bytes]
buf: bytes,
chunk_size: int
Parameters¶
buf: bytesThe response body to return.
The size of each chunk to send or -1 to send as a single chunk.. Defaults to -1.
async function bareutils.streaming.text_reader ¶
Summary¶
Extracts the body contents as text.
async bareutils.streaming.text_reader(
) -> str
body: AsyncIterable[bytes],
encoding: str
Parameters¶
body: AsyncIterable[bytes]The body of the request.
The encoding of the text. Defaults to 'utf-8'.
async generator function bareutils.streaming.text_writer ¶
Summary¶
Creates an asynchronous iterator from the supplied response body.
async bareutils.streaming.text_writer(
) -> AsyncIterable[bytes]
text: str,
encoding: str,
chunk_size: int
Parameters¶
text: strThe response body.
The encoding to apply when transforming the text into bytes. Defaults to 'utf-8'.
The size of each chunk to send or -1 to send as a single chunk.. Defaults to -1.