You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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_connection to every adapter, which outputs the fully-configured http client from options. Cleanup adapter connections #1023
Send ConnectionOptions to Env as :connection key.
Copy settings that configure the HTTP connection from RequestOptions to ConnectionOptions: :proxy, :bind, :timeout, :read_timeout, :open_timeout, :write_timeout
Teach Adapter#build_connection to merge ConnectionOptions with RequestOptions.
Remove manual merging of :proxy into RequestOptions
Teach Adapter#initialize to save the connection if it can:
If any of the moved RequestOptions settings 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
Add connection(&block) to yield a connection for the adapter to use:
If any of the moved RequestOptions settings are used, yield #build_connection)
If the adapter supports pooling, pass block to @pool.with
If the adapter does not support pooling, yield @conn
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
#build_connectionto every adapter, which outputs the fully-configured http client from options. Cleanup adapter connections #1023ConnectionOptionsto Env as:connectionkey.RequestOptionstoConnectionOptions::proxy, :bind, :timeout, :read_timeout, :open_timeout, :write_timeoutAdapter#build_connectionto mergeConnectionOptionswithRequestOptions.:proxyintoRequestOptionsAdapter#initializeto save the connection if it can:RequestOptionssettings are used, skip this!@pool = ConnectionPool.new(opts, &method(:build_connection))@conn = build_connectionconnection(&block)to yield a connection for the adapter to use:RequestOptionssettings are used, yield#build_connection)@pool.with@connProxy options???
faraday/lib/faraday/connection.rb
Lines 493 to 497 in ba7b82d