diff options
author | Nathan Fritz <fritzy@netflint.net> | 2009-09-01 00:06:46 +0000 |
---|---|---|
committer | Nathan Fritz <fritzy@netflint.net> | 2009-09-01 00:06:46 +0000 |
commit | 32ef496502bb338ee030b31ce7ba70e789995d9c (patch) | |
tree | f4eff3948f4cb22f9f6cce389dd258bdcfe0c94e /sleekxmpp | |
parent | 436841fa6faa1b9be5f40bb17f606366790ef5e8 (diff) | |
download | slixmpp-32ef496502bb338ee030b31ce7ba70e789995d9c.tar.gz slixmpp-32ef496502bb338ee030b31ce7ba70e789995d9c.tar.bz2 slixmpp-32ef496502bb338ee030b31ce7ba70e789995d9c.tar.xz slixmpp-32ef496502bb338ee030b31ce7ba70e789995d9c.zip |
added module config for number of threads
Diffstat (limited to 'sleekxmpp')
-rw-r--r-- | sleekxmpp/xmlstream/xmlstream.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index 958a3b6e..198aba0b 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -12,6 +12,8 @@ import traceback import types import xml.sax.saxutils +HANDLER_THREADS = 1 + ssl_support = True try: import ssl @@ -118,8 +120,9 @@ class XMLStream(object): raise RestartStream() def process(self, threaded=True): - self.__thread['eventhandle'] = threading.Thread(name='eventhandle', target=self._eventRunner) - self.__thread['eventhandle'].start() + for t in range(0, HANDLER_THREADS): + self.__thread['eventhandle%s' % t] = threading.Thread(name='eventhandle%s' % t, target=self._eventRunner) + self.__thread['eventhandle%s' % t].start() if threaded: self.__thread['process'] = threading.Thread(name='process', target=self._process) self.__thread['process'].start() @@ -269,7 +272,7 @@ class XMLStream(object): try: event = self.eventqueue.get(True, timeout=5) except queue.Empty: - even = None + event = None if event is not None: etype, handler, stanza = event if etype == 'stanza': |