MCPcopy
hub / github.com/scrapy/scrapy / _send_pending_requests

Method _send_pending_requests

scrapy/core/http2/protocol.py:176–189  ·  view source on GitHub ↗

Initiate all pending requests from the deque following FIFO We make sure that at any time {allowed_max_concurrent_streams} streams are active.

(self)

Source from the content-addressed store, hash-verified

174 )
175
176 def _send_pending_requests(self) -> None:
177 """Initiate all pending requests from the deque following FIFO
178 We make sure that at any time {allowed_max_concurrent_streams}
179 streams are active.
180 """
181 while (
182 self._pending_request_stream_pool
183 and self.metadata["active_streams"] < self.allowed_max_concurrent_streams
184 and self.h2_connected
185 ):
186 self.metadata["active_streams"] += 1
187 stream = self._pending_request_stream_pool.popleft()
188 stream.initiate_request()
189 self._write_to_transport()
190
191 def pop_stream(self, stream_id: int) -> Stream:
192 """Perform cleanup when a stream is closed"""

Callers 3

pop_streamMethod · 0.95
requestMethod · 0.95
settings_acknowledgedMethod · 0.95

Calls 2

_write_to_transportMethod · 0.95
initiate_requestMethod · 0.80

Tested by

no test coverage detected