core.common: move DummyExecutor to core.common.utils.concurrent

without backwards compat, unlikely it's been used by anyone
This commit is contained in:
Dima Gerasimov 2024-08-15 14:15:23 +03:00
parent b390f8b1cb
commit 1f8c719e6d
3 changed files with 52 additions and 41 deletions

View file

@ -121,7 +121,7 @@ def _iter_annotations(pdfs: Sequence[Path]) -> Iterator[Res[Annotation]]:
# todo how to print to stdout synchronously?
# todo global config option not to use pools? useful for debugging..
from concurrent.futures import ProcessPoolExecutor
from my.core.common import DummyExecutor
from my.core.utils.concurrent import DummyExecutor
workers = None # use 0 for debugging
Pool = DummyExecutor if workers == 0 else ProcessPoolExecutor
with Pool(workers) as pool: