Message296932
@Yuri, this bug doesn't require `gather`, here's a version with futures and explicit await's instead. It produces same output:
```
import asyncio
async def generator():
while True:
x = yield 42
print("received", x)
await asyncio.sleep(0.1)
async def user(name, g):
print("sending", name)
await g.asend(name)
async def helper():
g = generator()
await g.asend(None)
u0 = asyncio.ensure_future(user("user-0", g))
u1 = asyncio.ensure_future(user("user-1", g))
u2 = asyncio.ensure_future(user("user-2", g))
await u0
await u1
await u2
if __name__ == "__main__":
asyncio.get_event_loop().run_until_complete(helper())
```
Same with `asyncio.get_event_loop().create_task` as well. |
|
Date |
User |
Action |
Args |
2017-06-26 19:03:36 | Dima.Tisnek | set | recipients:
+ Dima.Tisnek, yselivanov |
2017-06-26 19:03:36 | Dima.Tisnek | set | messageid: <1498503816.42.0.421967874924.issue30773@psf.upfronthosting.co.za> |
2017-06-26 19:03:36 | Dima.Tisnek | link | issue30773 messages |
2017-06-26 19:03:36 | Dima.Tisnek | create | |
|