class documentation

class ScrapyPriorityQueue: (source)

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__() Optionally, the queue could provide a ``peek`` method, that should return the next object to be returned by ``pop``, but without removing it from the queue. ``__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 peek Returns the next object to be returned by :meth:`pop`, but without removing it from the queue.
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=()): (source)

Undocumented

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

Undocumented

def __len__(self): (source)

Undocumented

def close(self): (source)

Undocumented

def init_prios(self, startprios): (source)

Undocumented

def peek(self): (source)

Returns the next object to be returned by :meth:`pop`, but without removing it from the queue. Raises :exc:`NotImplementedError` if the underlying queue class does not implement a ``peek`` method, which is optional for queues.

def pop(self): (source)

Undocumented

def priority(self, request): (source)

Undocumented

def push(self, request): (source)

Undocumented

def qfactory(self, key): (source)

Undocumented

Undocumented

Undocumented

downstream_queue_cls = (source)

Undocumented

Undocumented

Undocumented