update from Atlas with major reorg

This commit is contained in:
Luciano Ramalho
2015-04-17 21:29:30 -03:00
parent 57902d31b5
commit a786180239
134 changed files with 369 additions and 520 deletions

View File

@@ -0,0 +1,19 @@
@asyncio.coroutine
def a(future):
print('a, future:', future, hex(id(future)))
res = yield from future
return res
def b():
future = asyncio.Future()
coro = a(future)
prime_result = next(coro)
print('b, prime_result:', prime_result, hex(id(future)))
loop = asyncio.get_event_loop()
future = asyncio.Future()
print('future:', future, hex(id(future)))
tasks = [asyncio.async(a(future))]
res = loop.run_until_complete(b())