aboutsummaryrefslogtreecommitdiffhomepage
path: root/sec_certs/parallel_processing.py
diff options
context:
space:
mode:
Diffstat (limited to 'sec_certs/parallel_processing.py')
-rw-r--r--sec_certs/parallel_processing.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sec_certs/parallel_processing.py b/sec_certs/parallel_processing.py
index 0e2ac175..912ef73b 100644
--- a/sec_certs/parallel_processing.py
+++ b/sec_certs/parallel_processing.py
@@ -1,6 +1,6 @@
from sec_certs.helpers import tqdm
from concurrent.futures import ProcessPoolExecutor as ProcessPool, ThreadPoolExecutor as ThreadPool
-from typing import Callable, Iterable, Optional
+from typing import Callable, Iterable, Optional, Union
import time
@@ -8,7 +8,7 @@ def process_parallel(func: Callable, items: Iterable, max_workers: int,
use_threading: bool = True, progress_bar: bool = True, unpack: bool = False,
progress_bar_desc: Optional[str] = None):
- pool: Union[Pool, ThreadPool] = ThreadPool(max_workers) if use_threading else Pool(max_workers)
+ pool: Union[ProcessPool, ThreadPool] = ThreadPool(max_workers) if use_threading else ProcessPool(max_workers)
results = [pool.submit(func, *i) for i in items] if unpack else [pool.submit(func, i) for i in items]
if progress_bar is True and items: