| 232 | |
| 233 | |
| 234 | class _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 | |
| 250 | def read_until_closed(observable, timeout=None): |
no outgoing calls