[Python-ideas] PEP 3156/Tulip: Extensible EventLoop interface

Paul Moore p.f.moore at gmail.com
Tue Feb 5 21:32:24 CET 2013


On 5 February 2013 04:50, Ben Darnell <ben at bendarnell.com> wrote:
>> Still, it's a pretty weak argument IMO -- I don't expect there to be a
>> significant cottage industry cranking out 3rd party protocol
>> implementations, assuming we add UDP to PEP 3156, which is my plan.
>
> Yeah, as long as we get TCP, UDP, SSL, and pipes (at least for
> subprocesses), I'm hard pressed to imagine anything else that would be in so
> much demand it would need to be supported by all event loops.

There are two thing that come to *my* mind whenever this sort of
debate comes up. I'll freely admit that they are 100% theoretical in
terms of my actual requirements, but neither is particular
implausible.

- Synchronisation primitlives like Windows event objects - wanting to
integrate code to be run when an event is set into an event loop seems
relatively reasonable.
- GUI input events - I don't know about Unix, but Windows GUI events
are a separate notification stream from network or pipe data, and it's
very plausible that someone would want to integrate GUI events into an
async app. Twisted, for instance, has GUI event loop integration
facilities, I believe.

(I know that "write your own event loop" is always a solution. But I'm
not sure that doesn't set the bar a bit too high - it depends on how
easy it is to reuse and extend the implementation of the standard
event loops, which is something I'm not really clear on yet).

Paul



More information about the Python-ideas mailing list