Remove and return all queued messages.
(self)
| 74 | raise |
| 75 | |
| 76 | def drain(self) -> list[str]: |
| 77 | """Remove and return all queued messages.""" |
| 78 | with self._lock: |
| 79 | items = [data for data, _ in self._queue] |
| 80 | self._queue.clear() |
| 81 | self._bytes = 0 |
| 82 | return items |
| 83 | |
| 84 | def __len__(self) -> int: |
| 85 | with self._lock: |