On Thu, Mar 5, 2009 at 1:09 PM, Bill Janssen <jans...@parc.com> wrote: > Josiah Carlson <josiah.carl...@gmail.com> wrote: > >> On Thu, Mar 5, 2009 at 12:46 PM, Greg Ewing <greg.ew...@canterbury.ac.nz> >> wrote: >> > Daniel Stutzbach wrote: >> > >> >> If you have a working select(), it will tell you the sockets on which >> >> read() and write() won't block, so non-blocking reads and writes are not >> >> necessary. >> > >> > No, but there should be an interface that lets you say >> > "when something comes in on this fd, call this function >> > for me". >> > >> > In other words it should be a light wrapper around >> > select/poll/whatever that provides a callback interface. >> >> A read callback, a write callback. What about close, error, connect, >> and accept callbacks? >> >> I hate to say it (not really), but that's pretty much the handle_*() >> methods of asyncore :/ . > > What asyncore was missing was a timer API (a way to register functions > to be called periodically). Then it would be pretty much like any other > event loop system.
There are two variants of patches to offer timer API functionality in the bug tracker right now. One from Giampaolo that uses a variant of Twisted's scheduler, one from me that uses an updated sched.py . Giampaolo's is more complete (it has documentation and tests), but mine is more efficient with nontrivial task lists. - Josiah _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com