Copies the current queue items.
(self)
| 37 | return len(self.queue) |
| 38 | |
| 39 | def copy(self) -> List[T]: |
| 40 | """Copies the current queue items.""" |
| 41 | copy = self.queue.copy() |
| 42 | |
| 43 | result = [] |
| 44 | while not copy.empty(): |
| 45 | result.append(copy.get_nowait()) |
| 46 | return result |
| 47 | |
| 48 | def __repr__(self) -> str: |
| 49 | return f"NotifyingQueue(id={id(self)}, num_items={len(self.queue)})" |
no outgoing calls