Beispiel #1
0
    def _schedule_callbacks(self, resp):
        callbacks = resp._registered_callbacks
        if not callbacks:
            return

        loop = get_loop()

        for cb, is_async in callbacks:
            if is_async:
                loop.create_task(cb())
            else:
                loop.run_in_executor(None, cb)
Beispiel #2
0
    def _schedule_callbacks(self, resp):
        callbacks = resp._registered_callbacks
        if not callbacks:
            return

        loop = get_loop()

        for cb in callbacks:
            if iscoroutinefunction(cb):
                loop.create_task(cb())
            else:
                loop.run_in_executor(None, cb)
Beispiel #3
0
 def __init__(self, file):
     self._file = file
     self._loop = get_loop()