Message305769
> So imagine a Future `fut` is completed. And we call `fut.add_done_callback()` in different contexts with different active event loops. With your suggestion we'll schedule our callbacks in different loops.
I'm wondering: does this situation occur in practice? Since Future isn't threadsafe, is there really a point in using it from several loops at once?
> Ideally you should use `loop.create_future()` when you can (and in libraries you usually can do that) to always make it explicit which loop your Future is attached to.
Unfortunately that's not possible in our case. Short version: we are using Tornado which creates a asyncio Future eagerly, see https://github.com/tornadoweb/tornado/blob/master/tornado/locks.py#L199 |
|
Date |
User |
Action |
Args |
2017-11-07 15:52:07 | pitrou | set | recipients:
+ pitrou, gvanrossum, giampaolo.rodola, yselivanov |
2017-11-07 15:52:07 | pitrou | set | messageid: <1510069927.78.0.213398074469.issue31960@psf.upfronthosting.co.za> |
2017-11-07 15:52:07 | pitrou | link | issue31960 messages |
2017-11-07 15:52:07 | pitrou | create | |
|