diff options
author | Nathan Fritz <fritzy@netflint.net> | 2009-08-31 22:46:31 +0000 |
---|---|---|
committer | Nathan Fritz <fritzy@netflint.net> | 2009-08-31 22:46:31 +0000 |
commit | 05c9ea5c1d953637343c9fad07267e7f89b20561 (patch) | |
tree | d4b0d432870bb195a4f14ec07ce889fcd080a357 /sleekxmpp/xmlstream/handler/waiter.py | |
parent | 00d46ee2b0fe4c0d76525d284dcc7ed588e701af (diff) | |
download | slixmpp-05c9ea5c1d953637343c9fad07267e7f89b20561.tar.gz slixmpp-05c9ea5c1d953637343c9fad07267e7f89b20561.tar.bz2 slixmpp-05c9ea5c1d953637343c9fad07267e7f89b20561.tar.xz slixmpp-05c9ea5c1d953637343c9fad07267e7f89b20561.zip |
* converted sleekxmpp to Python 3.x
* sleekxmpp no longer spawns threads for callback handlers -- there are now two threads: one for handlers and one for reading. callback handlers can get results from the read queue directly with the "wait" handler which is used in .send() for the reply catching argument.
Diffstat (limited to 'sleekxmpp/xmlstream/handler/waiter.py')
-rw-r--r-- | sleekxmpp/xmlstream/handler/waiter.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sleekxmpp/xmlstream/handler/waiter.py b/sleekxmpp/xmlstream/handler/waiter.py index 7c06ddf1..e62f330f 100644 --- a/sleekxmpp/xmlstream/handler/waiter.py +++ b/sleekxmpp/xmlstream/handler/waiter.py @@ -1,20 +1,23 @@ from . import base -import Queue +import queue import logging class Waiter(base.BaseHandler): def __init__(self, name, matcher): base.BaseHandler.__init__(self, name, matcher) - self._payload = Queue.Queue() + self._payload = queue.Queue() - def run(self, payload): + def prerun(self, payload): self._payload.put(payload) + + def run(self, payload): + pass def wait(self, timeout=60): try: return self._payload.get(True, timeout) - except Queue.Empty: + except queue.Empty: return False def checkDelete(self): |