class documentation

class ScrapyPriorityQueue:

View In Hierarchy

A priority queue implemented using multiple internal queues (typically, FIFO queues). It uses one internal queue for each priority value. The internal queue must implement the following methods:

  • push(obj)
  • pop()
  • close()
  • __len__()

__init__ method of ScrapyPriorityQueue 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.

Class Method from​_crawler Undocumented
Method __init__ Undocumented
Method __len__ Undocumented
Method close Undocumented
Method init​_prios Undocumented
Method pop Undocumented
Method priority Undocumented
Method push Undocumented
Method qfactory Undocumented
Instance Variable crawler Undocumented
Instance Variable curprio Undocumented
Instance Variable downstream​_queue​_cls Undocumented
Instance Variable key Undocumented
Instance Variable queues Undocumented
@classmethod
def from_crawler(cls, crawler, downstream_queue_cls, key, startprios=()):

Undocumented

def __init__(self, crawler, downstream_queue_cls, key, startprios=()):

Undocumented

def __len__(self):

Undocumented

def close(self):

Undocumented

def init_prios(self, startprios):

Undocumented

def pop(self):

Undocumented

def priority(self, request):

Undocumented

def push(self, request):

Undocumented

def qfactory(self, key):

Undocumented

crawler =

Undocumented

curprio =

Undocumented

downstream_queue_cls =

Undocumented

key =

Undocumented

queues: dict =

Undocumented