From 84b154c4d791968e93ac10d075c107ac8ac304ba Mon Sep 17 00:00:00 2001 From: Vostretsov Nikita Date: Tue, 6 Aug 2019 11:12:16 +0500 Subject: [PATCH] add docstring --- scrapy/pqueues.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scrapy/pqueues.py b/scrapy/pqueues.py index c9a606c16..76efe169a 100644 --- a/scrapy/pqueues.py +++ b/scrapy/pqueues.py @@ -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=()):