aboutsummaryrefslogtreecommitdiff
path: root/pyecsca/misc
diff options
context:
space:
mode:
authorJ08nY2024-04-03 14:41:17 +0200
committerJ08nY2024-04-03 14:41:17 +0200
commitc79dec57fd13142cf043c24f9c4977a1f8043b26 (patch)
treefa05840ab1975225e11517e45f19c2b960ebccc2 /pyecsca/misc
parenta115539931b4ca03f4009fcfaccc1a4c18517e58 (diff)
downloadpyecsca-c79dec57fd13142cf043c24f9c4977a1f8043b26.tar.gz
pyecsca-c79dec57fd13142cf043c24f9c4977a1f8043b26.tar.zst
pyecsca-c79dec57fd13142cf043c24f9c4977a1f8043b26.zip
Diffstat (limited to 'pyecsca/misc')
-rw-r--r--pyecsca/misc/utils.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/pyecsca/misc/utils.py b/pyecsca/misc/utils.py
index aa450e3..970924f 100644
--- a/pyecsca/misc/utils.py
+++ b/pyecsca/misc/utils.py
@@ -47,9 +47,16 @@ class TaskExecutor(ProcessPoolExecutor):
keys: List[Any]
futures: List[Future]
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self.keys = []
+ self.futures = []
+
def submit_task(self, key: Any, fn, /, *args, **kwargs):
- self.futures.append(self.submit(fn, *args, **kwargs))
+ future = self.submit(fn, *args, **kwargs)
+ self.futures.append(future)
self.keys.append(key)
+ return future
@property
def tasks(self):