aboutsummaryrefslogtreecommitdiffhomepage
path: root/sec_certs/cert_processing.py
diff options
context:
space:
mode:
Diffstat (limited to 'sec_certs/cert_processing.py')
-rw-r--r--sec_certs/cert_processing.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sec_certs/cert_processing.py b/sec_certs/cert_processing.py
index 739bfa9f..b5519aab 100644
--- a/sec_certs/cert_processing.py
+++ b/sec_certs/cert_processing.py
@@ -5,13 +5,16 @@ import time
def process_parallel(func: Callable, items: Iterable, max_workers: int, callback: Optional[Callable] = None,
- use_threading: bool = True, progress_bar: bool = True):
+ use_threading: bool = True, progress_bar: bool = True, unpack: bool = False):
if use_threading is True:
pool = ThreadPool(max_workers)
else:
pool = Pool(max_workers)
- results = [pool.apply_async(func, (i, ), callback=callback) for i in items]
+ if unpack is False:
+ results = [pool.apply_async(func, (i, ), callback=callback) for i in items]
+ else:
+ results = [pool.apply_async(func, (*i, ), callback=callback) for i in items]
if progress_bar is True:
bar = tqdm(total=len(results))