(self, block: bool = True)
| 111 | _logger.debug(f"Remaining items in queue collection done. Empty: {self._queue.empty()}") |
| 112 | |
| 113 | def get(self, block: bool = True) -> Any: |
| 114 | if not hasattr(self, "_first_get"): |
| 115 | self._first_get = True |
| 116 | if self._first_get: |
| 117 | timeout = 5.0 |
| 118 | self._first_get = False |
| 119 | else: |
| 120 | timeout = 0.5 |
| 121 | while True: |
| 122 | try: |
| 123 | return self._queue.get(block=block, timeout=timeout) |
| 124 | except Empty: |
| 125 | if self._done.value: |
| 126 | raise StopIteration # pylint: disable=raise-missing-from |
| 127 | |
| 128 | def put(self, obj: Any, block: bool = True, timeout: int | None = None) -> None: |
| 129 | self._queue.put(obj, block=block, timeout=timeout) |
no outgoing calls