Thomas Ploch wrote: > I am having troubles with implementing a timed queue. I am using > the 'Queue' module to manage several queues. But I want a timed > access, i.e. only 2 fetches per second max. I am horribly stuck on > even how I actually could write it. Has somebody done that before? > And when yes, how is the best way to implement it?
If you use an event loop system you could derive a class from your queue class whose "pop" method only returns an element if some timer has run out. After the maximum number of fetches you'd have to reset the timer. Regards, Björn -- BOFH excuse #327: The POP server is out of Coke -- http://mail.python.org/mailman/listinfo/python-list