MCPcopy
hub / github.com/scrapy/scrapy / wait_for

Method wait_for

scrapy/signalmanager.py:104–116  ·  view source on GitHub ↗

Await the next *signal*. See :ref:`start-requests-lazy` for an example.

(self, signal: Any)

Source from the content-addressed store, hash-verified

102 _signal.disconnect_all(signal, **kwargs)
103
104 async def wait_for(self, signal: Any) -> None:
105 """Await the next *signal*.
106
107 See :ref:`start-requests-lazy` for an example.
108 """
109 d: Deferred[None] = Deferred()
110
111 def handle() -> None:
112 self.disconnect(handle, signal)
113 d.callback(None)
114
115 self.connect(handle, signal)
116 await maybe_deferred_to_future(d)

Callers 1

startMethod · 0.80

Calls 2

connectMethod · 0.95
maybe_deferred_to_futureFunction · 0.90

Tested by 1

startMethod · 0.64