SleekXMPP/sleekxmpp/xmlstream/handler/waiter.py
Nathan Fritz 44aa526635 * fixed bugs with XEP 50 for components
* configuration-less nodes
2009-10-29 02:34:23 +00:00

25 lines
509 B
Python

from . import base
import queue
import logging
class Waiter(base.BaseHandler):
def __init__(self, name, matcher):
base.BaseHandler.__init__(self, name, matcher)
self._payload = queue.Queue()
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:
logging.warning("Timed out waiting for %s" % self.name)
return False
def checkDelete(self):
return True