[Python-Dev] Non-blocking (asynchronous) timer without thread?

Evgeniy Khramtsov xramtsov at gmail.com
Sat Dec 23 08:03:23 CET 2006


Josiah Carlson пишет:

>writing of a scheduler and the execution of scheduled tasks in a
>scheduler?  If so, you can implement it today (I would suggest using the
>heapq module, and/or the pair heap I posted to this list a few weeks ago),
>or you can use a previously existing mainloop for handling events
>(wx.App().MainLoop() works well, you just need to write a wx.EvtHandler
>subclass).
>
I did a dirty hack in the asyncore.py module, and now my asyncore objects
have methods for timers (self.start_timer, self.cancel_timer, etc.)
But I think that timer scheduling is a job for a python interpreter and 
it must be hidden from an end programmer.

Regards.


More information about the Python-Dev mailing list