Close the queue.
(self)
| 169 | return item |
| 170 | |
| 171 | async def close(self) -> None: |
| 172 | """Close the queue.""" |
| 173 | self._closed = True |
| 174 | for getter in self._getters: |
| 175 | if not getter.done(): |
| 176 | getter.set_exception(StopAsyncIteration()) |
| 177 | self._getters.clear() |
| 178 | |
| 179 | def stopped(self) -> bool: |
| 180 | """Check if there is no more data to read.""" |