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