blob: 140ce44319b223b65ae1102f9a482687d5f24542 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
from . import base
import queue
import logging
from .. stanzabase import StanzaBase
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 StanzaBase(stype='error')
def checkDelete(self):
return True
|