Esempio n. 1
0
 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
Esempio n. 2
0
    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
Esempio n. 3
0
    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
Esempio n. 4
0
 def __init__(self, name, matcher, stream=None):
     BaseHandler.__init__(self, name, matcher, stream=stream)
     self._payload = Queue()
Esempio n. 5
0
 def __init__(self, name, matcher, stream=None):
     BaseHandler.__init__(self, name, matcher, stream=stream)
     self._payload = Queue()
Esempio n. 6
0
 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