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
Hello. I want to reuse a Net::HTTP connection. However, I want to destroy (close) the connection after one sequence operation.
sample code
conn=Faraday.newdo |f|
f.adapter:net_http_persistent,pool_size: 5do |http|
http.idle_timeout=5endendconn.get('http://example.com/1')conn.get('http://example.com/2')# reuse connectionconn.get('http://example.com/3')# reuse connection, end of sequenceconn.close# I want to destroy connection pool# create new connection poolconn=Faraday.newdo |f|
f.adapter:net_http_persistent,pool_size: 5do |http|
http.idle_timeout=5endendconn.get('http://example.com/1')conn.get('http://example.com/2')# reuse connectionconn.get('http://example.com/3')# reuse connection, end of sequenceconn.close# I want to destroy connection pool
I think the conn.close method is just calling Faraday::Adapter::NetHttpPersistent.close. And Faraday::Adapter::NetHttpPersistent.close is not implemented.
I think calling @cached_connection.shutdown is destory connections, Like this.
Hello. I want to reuse a Net::HTTP connection. However, I want to destroy (close) the connection after one sequence operation.
sample code
I think the
conn.close
method is just callingFaraday::Adapter::NetHttpPersistent.close
. AndFaraday::Adapter::NetHttpPersistent.close
is not implemented.I think calling
@cached_connection.shutdown
is destory connections, Like this.Is there an easier way to destory a connection? Or is it a process that does not require destroying the connection?
The text was updated successfully, but these errors were encountered: