MCPcopy
hub / github.com/scrapy/scrapy / pop

Method pop

scrapy/pqueues.py:396–407  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

394 )
395
396 def pop(self) -> Request | None:
397 stats = self._downloader_interface.stats(self.pqueues)
398
399 if not stats:
400 return None
401
402 slot = self._next_slot(stats, update_state=True)
403 queue = self.pqueues[slot]
404 request = queue.pop()
405 if len(queue) == 0:
406 del self.pqueues[slot]
407 return request
408
409 def push(self, request: Request) -> None:
410 slot = self._downloader_interface.get_slot_key(request)

Callers

nothing calls this directly

Calls 3

_next_slotMethod · 0.95
statsMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected