[Pkg-bitcoin-commits] [python-quamash] 217/269: QThreadExecutor.shutdown(wait=True/False)
Jonas Smedegaard
dr at jones.dk
Fri Nov 24 11:26:35 UTC 2017
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository python-quamash.
commit d6d09e94782c8ae2df301032711bcf0c4bb64ea8
Author: Mark Harviston <mark.harviston at gmail.com>
Date: Sun Jan 18 15:35:31 2015 -0800
QThreadExecutor.shutdown(wait=True/False)
The standard concurrent.futures.Executor.shutdown has a wait parameter,
implement it.
---
quamash/__init__.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/quamash/__init__.py b/quamash/__init__.py
index 55a33dd..ded7244 100644
--- a/quamash/__init__.py
+++ b/quamash/__init__.py
@@ -142,7 +142,7 @@ class QThreadExecutor(QtCore.QObject):
def map(self, func, *iterables, timeout=None):
raise NotImplementedError("use as_completed on the event loop")
- def shutdown(self):
+ def shutdown(self, wait=True):
if self.__been_shutdown:
raise RuntimeError("QThreadExecutor has been shutdown")
@@ -152,8 +152,9 @@ class QThreadExecutor(QtCore.QObject):
for i in range(len(self.__workers)):
# Signal workers to stop
self.__queue.put(None)
- for w in self.__workers:
- w.wait()
+ if wait:
+ for w in self.__workers:
+ w.wait()
def __enter__(self, *args):
if self.__been_shutdown:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bitcoin/python-quamash.git
More information about the Pkg-bitcoin-commits
mailing list