Hi all,

I have been using asyncore until now, and am very excited about the new 
asyncio library, but there is one thing I have always missed on asyncore 
(although it was halfway there) which does not seem to be possible with 
asyncio (please correct me if I'm wrong):

On UNIX (Linux) the selectors module is specially powerful, since not only 
sockets can be used, but this extra power is crippled by the fact that 
there is no support (apparently) for select.select "exceptional condition" 
lists, or for select.poll "POLLPRI or POLLERR" events. I can imagine that 
the use-cases of these are a big mystery to many and probably few people 
actually know what they're for.

When using asyncore I usually extend the module by replacing the poll() 
function with my own version that supports "exceptional condition"-only 
dispatchers. These are very useful when dealing with direct character- and 
sysfs-device access on (embedded-)Linux systems for example.

One such example is the Linux GPIO sysfs interface. 
(see https://www.kernel.org/doc/Documentation/gpio/sysfs.txt for more 
info). Via this interface, one can manipulate digital input/output signals 
directly from user-space. One exceptionally (no pun intended) cool feature 
is the possibility of using inputs to trigger "software interrupts" in 
user-space via select() or poll().

Probably this functionality would have to be implemented in the selectors 
module first by means of support for EVENT_EXCEPTION in addition to 
EVENT_READ and EVENT_WRITE.

What about adding support for this to python selectors and asyncio? Would 
patches for something like this be accepted or is this out of the question?

Best regards,

Reply via email to