requests.connmanager
-
Declaration
struct
ConnManager
;Keep opened connections for HTTP. It is actually cache over tuple(schema, host, port) -> connection with limited number of items.
Discussion
Evict least used.
-
Declaration
NetworkStream
put
(stringschema
, stringhost
, ushortport
, NetworkStreamstream
);put
newstream
in cache, evict oldstream
and return it. If nothing evicted returnnull
. Returned(evicted) connection can be closed. -
Declaration
NetworkStream
get
(stringschema
, stringhost
, ushortport
);Lookup connection.
-
Declaration
NetworkStream
del
(stringschema
, stringhost
, ushortport
);Remove connection from cache (without close).
-
Declaration
void
clear
();clear
cache (and close connections)
-