nvflare.fuel.f3.streaming.stream_utils module

class FastBuffer(buf: bytes | bytearray | memoryview | list | None = None)[source]

Bases: object

A buffer with fast appending

append(buf: bytes | bytearray | memoryview | list)[source]

Fast append by doubling the size of the buffer when it runs out

to_bytes() bytes | bytearray | memoryview | list[source]

Return bytes-like object. Once this method is called, append() may not work any longer, since the buffer may have been exported

gen_stream_id() int[source]
stream_shutdown()[source]
stream_stats_category(channel: str, topic: str, stream_type: str = 'byte')[source]
wrap_view(buffer: bytes | bytearray | memoryview | list) memoryview[source]