Class | AWS::Core::Http::ConnectionPool |
In: |
lib/aws/core/http/connection_pool.rb
|
Parent: | Object |
@attr_reader [URI::HTTP,nil] proxy_uri Returns the configured proxy uri. @attr_reader [Float,nil] http_continue_timeout @attr_reader [Integer,Float] http_idle_timeout @attr_reader [Integer,Float] http_open_timeout @attr_reader [Integer,Float] http_read_timeout @attr_reader [Boolean] http_wire_trace @attr_reader [Logger,nil] logger @attr_reader [Boolean] ssl_verify_peer @attr_reader [String,nil] ssl_ca_file @attr_reader [String,nil] ssl_ca_path @api private
OPTIONS | = | [ :proxy_uri, :http_continue_timeout, :http_idle_timeout, :http_open_timeout, :http_read_timeout, :http_wire_trace, :logger, :ssl_verify_peer, :ssl_ca_file, :ssl_ca_path, ] | @api private |
http_wire_trace | -> | http_wire_trace? |
ssl_verify_peer | -> | ssl_verify_peer? |
Constructs and returns a new connection pool. This pool is never shared. @option (see new) @return [ConnectionPool]
Returns a connection pool constructed from the given options. Calling this method twice with the same options will return the same pool.
@option options [URI::HTTP,String] :proxy_uri A proxy to send
requests through. Formatted like 'http://proxy.com:123'.
@option options [Float] :http_continue_timeout (nil) The number of
seconds to wait for a 100-continue response before sending the request body. This option has no effect unless the request has "Expect" header set to "100-continue". Defaults to `nil` which disables this behaviour. This value can safely be set per-request on the session yeidled by {#session_for}.
@option options [Float] :http_idle_timeout (15) The number of
seconds a connection is allowed to sit idble before it is considered stale. Stale connections are closed and removed from the pool before making a request.
@option options [Float] :http_open_timeout (15) The number of
seconds to wait when opening a HTTP session before rasing a `Timeout::Error`.
@option options [Integer] :http_read_timeout (60) The default
number of seconds to wait for response data. This value can safely be set per-request on the session yeidled by {#session_for}.
@option options [Boolean] :http_wire_trace (false) When `true`, HTTP
debug output will be sent to the `:logger`.
@option options [Logger] :logger Where debug output is sent.
Defaults to `nil` when `:http_wire_trace` is `false`. Defaults to `Logger.new($stdout)` when `:http_wire_trace` is `true`.
@option options [Boolean] :ssl_verify_peer (true) When `true`, SSL
peer certificates are verified when establishing a connection.
@option options [String] :ssl_ca_file Full path to the SSL
certificate authority bundle file that should be used when verifying peer certificates. If you do not pass `:ssl_ca_file` or `:ssl_ca_path` the the system default will be used if available.
@option options [String] :ssl_ca_path Full path of the directory
that contains the unbundled SSL certificate authority files# for verifying peer certificates. If you do not pass `:ssl_ca_file` or `:ssl_ca_path` the the system default will be used if available.
@return [ConnectionPool]
Closes and removes removes all sessions from the pool. If empty! is called while there are outstanding requests they may get checked back into the pool, leaving the pool in a non-empty state. @return [nil]
Makes an HTTP request, yielding a Net::HTTPResponse object.
pool.request('http://google.com', Net::HTTP::Get.new('/')) do |resp| puts resp.code # status code puts resp.to_h.inspect # dump the headers puts resp.body end
@param [URI::HTTP,URI::HTTPS,String] endpoint The HTTP(S) endpoint to
connect to (e.g. 'https://domain.com').
@param [Net::HTTPRequest] request The request to make. This can be
any request object from Net::HTTP (e.g. Net::HTTP::Get, Net::HTTP::POST, etc).
@yieldparam [Net::HTTPResponse] net_http_response
@return (see session_for
@param [URI::HTTP,URI::HTTPS,String] endpoint The HTTP(S) endpoint to
connect to (e.g. 'https://domain.com').
@yieldparam [Net::HTTPSession] session
@return [nil]