-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
This is a tracking issue for a larger effort to refactor the adapters to support connection pools. #1006 proved it could work in theory, but I think the code bass will need some more massaging to fully support it. I outlined why in #1006 (comment).
TODO
- Add
#build_connectionto every adapter, which outputs the fully-configured http client from options. Cleanup adapter connections #1023 - Send
ConnectionOptionsto Env as:connectionkey. - Copy settings that configure the HTTP connection from
RequestOptionstoConnectionOptions::proxy, :bind, :timeout, :read_timeout, :open_timeout, :write_timeout - Teach
Adapter#build_connectionto mergeConnectionOptionswithRequestOptions. - Remove manual merging of
:proxyintoRequestOptions - Teach
Adapter#initializeto save the connection if it can:- If any of the moved
RequestOptionssettings are used, skip this! - If the adapter supports pooling,
@pool = ConnectionPool.new(opts, &method(:build_connection)) - If the adapter does not support pooling,
@conn = build_connection
- If any of the moved
- Add
connection(&block)to yield a connection for the adapter to use:- If any of the moved
RequestOptionssettings are used, yield#build_connection) - If the adapter supports pooling, pass block to
@pool.with - If the adapter does not support pooling, yield
@conn
- If any of the moved
Proxy options???
faraday/lib/faraday/connection.rb
Lines 493 to 497 in ba7b82d
| # Resets temp_proxy | |
| @temp_proxy = proxy_for_request(url) | |
| request = build_request(method) do |req| | |
| req.options = req.options.merge(proxy: @temp_proxy) |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels