MCPcopy
hub / github.com/scrapy/scrapy / start

Method start

tests/test_engine_loop.py:33–61  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

31 name = "test"
32
33 async def start(self):
34 yield Request("data:,a")
35
36 await async_sleep(seconds)
37
38 self.crawler.engine._slot.scheduler.pause()
39 self.crawler.engine._slot.scheduler.enqueue_request(Request("data:,b"))
40
41 # During this time, the scheduler reports having requests but
42 # returns None.
43 await async_sleep(seconds)
44
45 self.crawler.engine._slot.scheduler.unpause()
46
47 # The scheduler request is processed.
48 await async_sleep(seconds)
49
50 yield Request("data:,c")
51
52 await async_sleep(seconds)
53
54 self.crawler.engine._slot.scheduler.pause()
55 self.crawler.engine._slot.scheduler.enqueue_request(Request("data:,d"))
56
57 # The last start request is processed during the time until the
58 # delayed call below, proving that the start iteration can
59 # finish before a scheduler “sleep” without causing the
60 # scheduler to finish.
61 call_later(seconds, self.crawler.engine._slot.scheduler.unpause)
62
63 def parse(self, response):
64 pass

Callers

nothing calls this directly

Calls 7

RequestClass · 0.90
async_sleepFunction · 0.90
call_laterFunction · 0.90
close_asyncMethod · 0.80
pauseMethod · 0.45
enqueue_requestMethod · 0.45
unpauseMethod · 0.45

Tested by

no test coverage detected