Skip to content

Commit

Permalink
Add delete function
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Oct 31, 2023
1 parent 7d7bd99 commit 56eae55
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pympipool/shared/executorbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def shutdown(self, wait=True, *, cancel_futures=False):
def __len__(self):
return self._future_queue.qsize()

def __del__(self):
self.shutdown(wait=True, cancel_futures=True)

def _set_init_function(self, init_function):
if init_function is not None:
self._future_queue.put(
Expand Down

0 comments on commit 56eae55

Please sign in to comment.