[Python-ideas] async: feedback on EventLoop API

Guido van Rossum guido at python.org
Tue Dec 18 23:51:05 CET 2012


On Tue, Dec 18, 2012 at 11:41 AM, Richard Oudkerk <shibturn at gmail.com> wrote:
> polling.py in the proactor branch already had an implementation of
> socketpair() for Windows;-)

D'oh! And it always uses sockets for the "self-pipe". That makes sense.

> Also note that on Windows a connecting socket needs to be added to wfds
> *and* xfds when you do
>
>     ... = select(rfds, wfds, xfds, timeout)
>
> If the connection fails then the handle is reported as being exceptional but
> *not* writable.

But SelectProactor in proactor.py doesn't seem to do this.

> It might make sense to have add_connector()/remove_connector() which on Unix
> is just an alias for add_writer()/remove_writer().  This would be useful if
> tulip ever has a loop based on WSAPoll() for Windows (Vista and later),
> since WSAPoll() has an awkward bug concerning asynchronous connects.

Can't we do this for all writers? (If we have to make a distinction,
so be it, but it seems easy to have latent bugs if some platforms
require you to make a different call but others don't care either
way.)

-- 
--Guido van Rossum (python.org/~guido)



More information about the Python-ideas mailing list