From 05121c60bf1d336634d1cc2f50a55046d4eec10b Mon Sep 17 00:00:00 2001 From: Shital Shah Date: Wed, 30 Aug 2023 00:47:36 -0700 Subject: [PATCH] added doc string for stream --- tensorwatch/stream.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tensorwatch/stream.py b/tensorwatch/stream.py index 3e9de63..99b268a 100644 --- a/tensorwatch/stream.py +++ b/tensorwatch/stream.py @@ -7,6 +7,21 @@ from . import utils from .lv_types import StreamItem class Stream: + """ + Stream allows you to write values into it. One stream can subscribe to many streams. When a value is + written in the stream, all subscribers also gets that value written into them (the from_steam parameter + is set to the source stream). + + You can read values from a stream by calling read_all method. This will yield values as someone or subscribed streams are + writing into the stream. You can also load all values from the stream. The default stream won't load anything but + derived streams like file may load all values from the file and write into themselves. + + You can think of stream as a pipe that can be chained to other pipees. As value is put in pipe, it travels through + connected pipes. The read_all method is like a tap that you can use to read values from the pipe. The load method is + for specialized streams that may generate values in that pipe. + + Stream class supports full multi-threading. + """ def __init__(self, stream_name:str=None, console_debug:bool=False): self._subscribers = weakref.WeakSet() self._subscribed_to = weakref.WeakSet()