def __init__(self, name, matcher, pointer, thread=False, once=False, instream=False, stream=None): BaseHandler.__init__(self, name, matcher, stream) self._pointer = pointer self._once = once self._instream = instream
def __init__(self, name, matcher, pointer, once=False, instream=False, stream=None): BaseHandler.__init__(self, name, matcher, stream) if not asyncio.iscoroutinefunction(pointer): raise ValueError("Given function is not a coroutine") async def pointer_wrapper(stanza, *args, **kwargs): try: await pointer(stanza, *args, **kwargs) except Exception as e: stanza.exception(e) self._pointer = pointer_wrapper self._once = once self._instream = instream
def __init__(self, name, matcher, stream=None): BaseHandler.__init__(self, name, matcher, stream=stream) self._payload = Queue()