[Python-ideas] Add a generic async IO poller/reactor to select module

Giampaolo Rodolà g.rodola at gmail.com
Thu May 24 15:06:18 CEST 2012


2012/5/24 Ronald Oussoren <ronaldoussoren at mac.com>:
>
> On 24 May, 2012, at 14:03, Antoine Pitrou wrote:
>
>> On Thu, 24 May 2012 13:50:27 +0200
>> Giampaolo Rodolà <g.rodola at gmail.com>
>> wrote:
>>> 2012/5/24 Ronald Oussoren <ronaldoussoren at mac.com>:
>>>>
>>>> On 24 May, 2012, at 3:32, Giampaolo Rodolà wrote:
>>>>>>>>
>>>>>
>>>>> The handler is supposed to provide 3 methods:
>>>>> - handle_read_event
>>>>> - handle_write_event
>>>>> - handle_error_event
>>>>>
>>>>> Users willing to support multiple event loops such as wx, gtk etc can do:
>>>>>
>>>>>>>> while 1:
>>>>> ...       poller.poll(timeout=0.1, blocking=False)
>>>>> ...       otherpoller.poll()
>>>>>
>>>>>
>>>>> Basically, this would be the whole API.
>>>>
>>>> Isn't this a limited version of asyncore? (poller.poll == asyncore.loop, the handler is a subset of asyncore.dispatcher).
>>>>
>>>> Ronald
>>>
>>> poller.poll serves the same purpose of asyncore.loop, yes, but this is
>>> supposed to be independent from asyncore.
>>
>> I agree with Ronald that it looks like a less-braindead version of
>> asyncore. I don't think the select module is the right place.
>
> What worries me most is that it might only look like a beter version of asyncore.

Please, forget about asyncore: this has nothing to do with it per-se
as it's just a reactor - it doesn't aim to provide any connection
handling.
Given the poor asyncore API I doubt it would be even integrable with
it without breaking backward compatibility.

--- Giampaolo
http://code.google.com/p/pyftpdlib/
http://code.google.com/p/psutil/
http://code.google.com/p/pysendfile/



More information about the Python-ideas mailing list