MCPcopy
hub / github.com/scrapy/scrapy / _new_connection

Method _new_connection

scrapy/core/http2/agent.py:70–89  ·  view source on GitHub ↗
(
        self, key: ConnectionKeyT, uri: URI, endpoint: HostnameEndpoint
    )

Source from the content-addressed store, hash-verified

68 return self._new_connection(key, uri, endpoint)
69
70 def _new_connection(
71 self, key: ConnectionKeyT, uri: URI, endpoint: HostnameEndpoint
72 ) -> Deferred[H2ClientProtocol]:
73 self._pending_requests[key] = deque()
74
75 conn_lost_deferred: Deferred[list[BaseException]] = Deferred()
76 conn_lost_deferred.addCallback(self._remove_connection, key)
77
78 factory = H2ClientFactory(
79 uri,
80 self.settings,
81 conn_lost_deferred,
82 tls_verbose_logging=self._tls_verbose_logging,
83 )
84 conn_d = endpoint.connect(factory)
85 conn_d.addCallback(self.put_connection, key)
86
87 d: Deferred[H2ClientProtocol] = Deferred()
88 self._pending_requests[key].append(d)
89 return d
90
91 def put_connection(
92 self, conn: H2ClientProtocol, key: ConnectionKeyT

Callers 1

get_connectionMethod · 0.95

Calls 2

H2ClientFactoryClass · 0.90
connectMethod · 0.45

Tested by

no test coverage detected