[Python-ideas] Add hooks to asyncio lifecycle

Michel Desmoulin desmoulinmichel at gmail.com
Mon Jun 11 04:23:18 EDT 2018

I like it.

First, it solves the issue for policies, and let people decide how they
want to deal with the problem (drop the lib, subclass the
policy/factory, etc).

But it also solves the problem for loops, because loops are set by the
task factory, and so you can easily check somebody is changing your loop
from you locked policy and do whatever you want.

This also solves the problem of:

- task factories
- event loop life cycle hooks

Indeed, if somebody needs those, he/she can implement a custom loop,
which can be safe guarded by the policy, which is locked.

It doesn't have the drawback of my proposal of being overly general, and
is quite simple to implement. But it does let people get creative with
the stack.

More information about the Python-ideas mailing list