mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-24 11:09:58 +00:00
22 lines
413 B
Python
22 lines
413 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 run(self, payload):
|
||
|
self._payload.put(payload)
|
||
|
|
||
|
def wait(self, timeout=60):
|
||
|
try:
|
||
|
return self._payload.get(True, timeout)
|
||
|
except Queue.Empty:
|
||
|
return False
|
||
|
|
||
|
def checkDelete(self):
|
||
|
return True
|