lib/httpx/connection.rb in httpx-0.21.1 vs lib/httpx/connection.rb in httpx-0.22.0
- old
+ new
@@ -74,9 +74,16 @@
@total_timeout = @options.timeout[:total_timeout]
self.addresses = @options.addresses if @options.addresses
end
+ def clone_new_connection
+ new_conn = self.class.new(@type, @origin, @options)
+ once(:open, &new_conn.method(:reset))
+ new_conn.once(:open, &method(:close))
+ new_conn
+ end
+
# this is a semi-private method, to be used by the resolver
# to initiate the io object.
def addresses=(addrs)
if @io
@io.add_addresses(addrs)