nvflare.fuel.f3.streaming.byte_receiver module¶
- class ByteReceiver(cell: CoreCell)[source]¶
Bases:
object
- stop_task(task: RxTask, error: StreamError | None = None, notify=True)[source]¶
- class RxStream(byte_receiver: ByteReceiver, task: RxTask)[source]¶
Bases:
Stream
A stream that’s used to read streams from the buffer
Constructor for stream
- Parameters:
size – The total size of stream. 0 if unknown
headers – Optional headers to be passed to the receiver
- read(chunk_size: int) bytes [source]¶
Read and return up to chunk_size bytes. It can return less but not more than the chunk_size. An empty bytes object is returned if the stream reaches the end.
- Parameters:
chunk_size – Up to (but maybe less) this many bytes will be returned
- Returns:
Binary data. If empty, it means the stream is depleted (EOF)