MCPcopy
hub / github.com/bugy/script-server / _StoringObserver

Class _StoringObserver

src/react/observable.py:234–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232
233
234class _StoringObserver:
235 def __init__(self):
236 self.data = []
237 self.closed = False
238
239 def on_next(self, chunk):
240 if not self.closed:
241 self.data.append(chunk)
242
243 def on_close(self):
244 if self.closed:
245 raise Exception('Already closed')
246
247 self.closed = True
248
249
250def read_until_closed(observable, timeout=None):

Calls

no outgoing calls