"Sven R. Kunze" <srku...@mail.de> writes: > Basically a task scheduler where tasks can be thrown away once they > are too long in the queue.
I don't think there's a real nice way to do this with heapq. The computer-sciencey way would involve separate balanced tree structures for the two sorting keys (think of a database table with indexes on two different columns). You could look up "timing wheels" for a simpler practical approach that the Linux kernel scheduler used to use (I think it changed a few years ago). -- https://mail.python.org/mailman/listinfo/python-list