> WaitMsg will get only msg with certain ids, but this is not possible > in Queue object, because Queue provides no method to peek into the > message queue and fetch only matched item. > > Now I'm using an ugly solution, fetch all the messages and put the not > used ones back to the queue. But I want a better performance. Is there > any alternative out there? >
You could try a defaultdict containing queues, one queue per message ID. Or you could implement your own thread-safe LookAheadQueue class. David -- http://mail.python.org/mailman/listinfo/python-list