Author Dima.Tisnek
Recipients Dima.Tisnek, yselivanov
Date 2017-06-26.19:03:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1498503816.42.0.421967874924.issue30773@psf.upfronthosting.co.za>
In-reply-to
Content
@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.
History
Date User Action Args
2017-06-26 19:03:36Dima.Tisneksetrecipients: + Dima.Tisnek, yselivanov
2017-06-26 19:03:36Dima.Tisneksetmessageid: <1498503816.42.0.421967874924.issue30773@psf.upfronthosting.co.za>
2017-06-26 19:03:36Dima.Tisneklinkissue30773 messages
2017-06-26 19:03:36Dima.Tisnekcreate