mirror of https://github.com/scrapy/scrapy.git
add docstring
This commit is contained in:
parent
f4437202fa
commit
84b154c4d7
|
|
@ -30,6 +30,25 @@ def _path_safe(text):
|
|||
|
||||
|
||||
class ScrapyPriorityQueue(object):
|
||||
"""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 downstream_queue_cls argument, which is a class
|
||||
used to instantiate a new (internal) queue when a new priority is allocated.
|
||||
|
||||
Only integer priorities should be used. Lower numbers are higher
|
||||
priorities.
|
||||
|
||||
startprios is a sequence of priorities to start with. If the queue was
|
||||
previously closed leaving some priority buckets non-empty, those priorities
|
||||
should be passed in startprios.
|
||||
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def from_crawler(cls, crawler, downstream_queue_cls, key, startprios=()):
|
||||
|
|
|
|||
Loading…
Reference in New Issue