module documentation

Buffer byte streams.

Class StreamOpen Open a new stream.
Class StreamReceiver Buffering de-multiplexing byte stream receiver.
Class StreamWrite Write a chunk of data to a stream.
Function chunk Break a byte string into pieces of no more than ``chunkSize`` length.
Async Function stream Send the given stream chunks, one by one, over the given connection.
Type Variable T Undocumented
def chunk(data: bytes, chunkSize: int) -> Iterator[bytes]: (source)

Break a byte string into pieces of no more than ``chunkSize`` length.

Parameters
data:bytesThe byte string.
chunkSize:intThe maximum length of the resulting pieces. All pieces except possibly the last will be this length.
Returns
Iterator[bytes]The pieces.
async def stream(amp: AMP, chunks: Iterator[bytes]) -> int: (source)

Send the given stream chunks, one by one, over the given connection.

The chunks are sent using StreamWrite over a stream opened using StreamOpen.

Returns
intThe identifier of the stream over which the chunks were sent.

Undocumented

Value
TypeVar('T')