def func(fut): try: value = aiogevent.yield_future(fut) except Exception: result.append('error') else: result.append(value) self.loop.stop()
def func(fut): try: value = aiogevent.yield_future(fut, loop=loop2) except Exception as exc: result.append(str(exc)) else: result.append(value) self.loop.stop()
def greenlet_yield_future(result, loop): try: value = aiogevent.yield_future(coro_slow_append(result, 1, 0.020)) result.append(value) value = aiogevent.yield_future(coro_slow_append(result, 2, 0.010)) result.append(value) try: value = aiogevent.yield_future(coro_slow_error()) except ValueError as exc: result.append(str(exc)) result.append(4) return result except Exception as exc: result.append(repr(exc)) finally: loop.stop()
def func(obj): return aiogevent.yield_future(obj)
def func(event, fut): event.set() value = aiogevent.yield_future(fut) result.append(value) self.loop.stop()
def func(fut): value = aiogevent.yield_future(coro_slow_append(result, 3)) result.append(value) self.loop.stop()
load_module("wait") load_module("logging") #load_module("on_event") load_module("net") load_module("data") load_module("block") load_module("qbroker") load_module("state") load_module("errors") #load_module("trigger") load_module("help") k = spawn(run, "qbroker", input) j = spawn(gtester) f = aiogevent.wrap_greenlet(j, loop=qbroker.loop) #qbroker.loop.run_until_complete(f) aiogevent.yield_future(f) assert seen try: k.kill() finally: k.join() try: j.kill() finally: j.join() import sys sys.exit(0)
load_module("logging") # load_module("on_event") load_module("net") load_module("data") load_module("block") load_module("qbroker") load_module("state") load_module("errors") # load_module("trigger") load_module("help") k = spawn(run, "qbroker", input) j = spawn(gtester) f = aiogevent.wrap_greenlet(j, loop=qbroker.loop) # qbroker.loop.run_until_complete(f) aiogevent.yield_future(f) assert seen try: k.kill() finally: k.join() try: j.kill() finally: j.join() import sys sys.exit(0)