Example #1
0
 def func(fut):
     try:
         value = aiogevent.yield_future(fut)
     except Exception:
         result.append('error')
     else:
         result.append(value)
     self.loop.stop()
Example #2
0
 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()
Example #3
0
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()
Example #4
0
 def func(obj):
     return aiogevent.yield_future(obj)
Example #5
0
 def func(event, fut):
     event.set()
     value = aiogevent.yield_future(fut)
     result.append(value)
     self.loop.stop()
Example #6
0
 def func(fut):
     value = aiogevent.yield_future(coro_slow_append(result, 3))
     result.append(value)
     self.loop.stop()
Example #7
0
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)
Example #8
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)