nvflare.fuel.f3.streaming.blob_streamer module¶
- class BlobHandler(blob_cb: Callable)[source]¶
Bases:
object- handle_blob_cb(future: StreamFuture, stream: Stream, resume: bool, *args, **kwargs) int[source]¶
- class BlobStream(blob: bytes | bytearray | memoryview | list, headers: dict | None)[source]¶
Bases:
StreamConstructor 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 | bytearray | memoryview | list[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)
- class BlobStreamer(byte_streamer: ByteStreamer, byte_receiver: ByteReceiver)[source]¶
Bases:
object- send(channel: str, topic: str, target: str, message: Message, secure: bool, optional: bool) StreamFuture[source]¶
- class BlobTask(future: StreamFuture, stream: Stream)[source]¶
Bases:
object