add docstring

This commit is contained in:
Vostretsov Nikita 2019-08-06 11:12:16 +05:00
parent f4437202fa
commit 84b154c4d7
1 changed files with 19 additions and 0 deletions

View File

@ -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=()):