diff options
author | Lance Stout <lancestout@gmail.com> | 2012-04-20 15:19:56 -0700 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2012-04-20 15:21:31 -0700 |
commit | 8ee30179eae3b6697629aad50ca31df9daa5ef6e (patch) | |
tree | 7024d566a475a9202734eba9d8156b18f938ad8a /sleekxmpp/xmlstream/scheduler.py | |
parent | cb2469322b68cfc0c3761fdcb0cd6acafa0a3647 (diff) | |
download | slixmpp-8ee30179eae3b6697629aad50ca31df9daa5ef6e.tar.gz slixmpp-8ee30179eae3b6697629aad50ca31df9daa5ef6e.tar.bz2 slixmpp-8ee30179eae3b6697629aad50ca31df9daa5ef6e.tar.xz slixmpp-8ee30179eae3b6697629aad50ca31df9daa5ef6e.zip |
Add _use_daemons flag to XMLStream to run all threads in daemon mode.
This WILL make the Python interpreter produce exceptions on shutdown.
Diffstat (limited to 'sleekxmpp/xmlstream/scheduler.py')
-rw-r--r-- | sleekxmpp/xmlstream/scheduler.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sleekxmpp/xmlstream/scheduler.py b/sleekxmpp/xmlstream/scheduler.py index 8ec73164..6f6e0278 100644 --- a/sleekxmpp/xmlstream/scheduler.py +++ b/sleekxmpp/xmlstream/scheduler.py @@ -121,7 +121,7 @@ class Scheduler(object): #: Lock for accessing the task queue. self.schedule_lock = threading.RLock() - def process(self, threaded=True): + def process(self, threaded=True, daemon=False): """Begin accepting and processing scheduled tasks. :param bool threaded: Indicates if the scheduler should execute @@ -130,6 +130,7 @@ class Scheduler(object): if threaded: self.thread = threading.Thread(name='scheduler_process', target=self._process) + self.thread.daemon = daemon self.thread.start() else: self._process() |