[Python-ideas] PEP 3156: Clarifying the different components of the event loop API

Nick Coghlan ncoghlan at gmail.com
Sun Jan 20 07:31:32 CET 2013


On Sun, Jan 20, 2013 at 12:34 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Do things (and get the result with "yield from"):
> - wrap_future() # Perhaps "wrap_executor_future"?
> - run_in_executor()
> - getaddrinfo()
> - getnameinfo()
>
> Low level transport creation:
> - create_connection()
> - create_pipe() # Once it exists in the PEP

Somewhere early in the PEP, there may need to be a concise description
of the two APIs for waiting for an asynchronous Future:

1. "f.add_done_callback()"
2. "yield from f" in a coroutine (resumes the coroutine when the
future completes, with either the result or exception as appropriate)

At the moment, these are buried in amongst much larger APIs, yet
they're key to understanding the way everything above the core event
loop layer interacts.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



More information about the Python-ideas mailing list