On Sat, Nov 3, 2012 at 3:06 PM, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

FWIW, I've been studying other event loops. It's interesting to see<br>
the similarities (and differences) between e.g. the tulip eventloop,<br>
pyftpd's ioloop, Tornado's IOLoop, and 0MQ's IOLoop. The latter two<br>
look very similar, except that 0MQ makes the poller pluggable, but<br>
generally there are lots of similarities between the structure of all<br>
four. Twisted, as usual, stands apart. :-)<br></blockquote><div><br></div><div>Pyzmq's IOLoop is actually a fork/monkey-patch of Tornado's, and they have the same pluggable-poller implementation (In the master branch of Tornado it's been moved to the PollIOLoop subclass).  </div>

<div><br></div><div>-Ben</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
--Guido<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Sat, Nov 3, 2012 at 2:20 PM, Richard Oudkerk <<a href="mailto:shibturn@gmail.com">shibturn@gmail.com</a>> wrote:<br>
> On 02/11/2012 11:59pm, Guido van Rossum wrote:<br>
>><br>
>> Working code or it didn't happen. (And it should scale too.)<br>
><br>
><br>
> I have some (mostly) working code which replaces tulip's "pollster" classes<br>
> with "proactor" classes for select(), poll(), epoll() and IOCP.  See<br>
><br>
><br>
> <a href="https://bitbucket.org/sbt/tulip-proactor/changeset/c64ff42bf0f2679437838ee7795adb85" target="_blank">https://bitbucket.org/sbt/tulip-proactor/changeset/c64ff42bf0f2679437838ee7795adb85</a><br>
><br>
> The IOCP proactor does not support ssl (or ipv6) so main.py does not succeed<br>
> in downloading from <a href="http://xkcd.com" target="_blank">xkcd.com</a> using ssl.  Using the other proactors it works<br>
> correctly.<br>
><br>
> The basic interface for the proactor looks like<br>
><br>
>     class Proactor:<br>
>         def recv(self, sock, n): ...<br>
>         def send(self, sock, buf): ...<br>
>         def connect(self, sock, address): ...<br>
>         def accept(self, sock): ...<br>
><br>
>         def poll(self, timeout=None): ...<br>
>         def pollable(self): ...<br>
><br>
> recv(), send(), connect() and accept() initiate io operations and return<br>
> futures.  poll() returns a list of ready futures.  pollable() returns true<br>
> if there are any outstanding operations registered with the proactor.  You<br>
> use a pattern like<br>
><br>
>     f = proactor.recv(sock, 100)<br>
>     if not f.done():<br>
>         yield from scheduling.block_future(f)<br>
>     res = f.result()<br>
><br>
> --<br>
> Richard<br>
><br>
><br>
> _______________________________________________<br>
> Python-ideas mailing list<br>
> <a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
> <a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
<br>
<br>
<br>
</div></div><div class="im HOEnZb">--<br>
--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)<br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
</div></div></blockquote></div><br></div>