(maxsize: int)
| 119 | |
| 120 | @contextlib.contextmanager |
| 121 | def _thread_mapper(maxsize: int) -> Generator[ |
| 122 | Callable[[Callable[[TArg], TRet], Iterable[TArg]], Iterable[TRet]], |
| 123 | ]: |
| 124 | if maxsize == 1: |
| 125 | yield map |
| 126 | else: |
| 127 | with concurrent.futures.ThreadPoolExecutor(maxsize) as ex: |
| 128 | yield ex.map |
| 129 | |
| 130 | |
| 131 | def xargs( |