Equivalent to asyncio.gather or Thread.join()
(
*tasks: threading.Thread, timeout: float | None = None, timeout_hint: str = ""
)
| 141 | |
| 142 | |
| 143 | def gather( |
| 144 | *tasks: threading.Thread, timeout: float | None = None, timeout_hint: str = "" |
| 145 | ) -> None: |
| 146 | """ |
| 147 | Equivalent to asyncio.gather or Thread.join() |
| 148 | """ |
| 149 | for t in tasks: |
| 150 | if not t.is_alive(): |
| 151 | continue |
| 152 | t.join(timeout) |
| 153 | if not t.is_alive(): |
| 154 | continue |
| 155 | logger.warning("couldn't stop thread %r within %s seconds", t.name, timeout) |
| 156 | if timeout_hint: |
| 157 | logger.warning("hint: %s", timeout_hint) |
| 158 | |
| 159 | |
| 160 | def asleep(seconds: float) -> Coroutine[Any, Any, None]: |