(self)
| 148 | self.cleanup() |
| 149 | |
| 150 | def __iter__(self) -> Generator[Any, None, None]: |
| 151 | if not self._activated: |
| 152 | raise ValueError( |
| 153 | "Need to call activate() to launch a daemon worker " |
| 154 | "to produce data into data queue before using it. " |
| 155 | "You probably have forgotten to use the DataQueue in a with block.", |
| 156 | ) |
| 157 | return self._consumer() |
| 158 | |
| 159 | def _consumer(self) -> Generator[Any, None, None]: |
| 160 | while True: |