Coverage for scrapy/utils/pqueue : 96%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
"""A priority queue implemented using multiple internal queues (typically, FIFO queues). The internal queue must implement the following methods:
* push(obj) * pop() * close() * __len__()
The constructor receives a qfactory argument, which is a callable used to instantiate a new (internal) queue when a new priority is allocated. The qfactory function is called with the priority number as first and only argument.
Only integer priorities should be used. Lower numbers are higher priorities. """
self.queues[p] = self.qfactory(p)
|