Class: Gem::Request::HTTPPool
Do not use. This class is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
|
|
Inherits: | Object |
Defined in: | lib/rubygems/request/http_pool.rb |
Overview
Class Method Summary
Instance Attribute Summary
- #cert_files readonly
- #proxy_uri readonly
Instance Method Summary
Constructor Details
.new(http_args, cert_files, proxy_uri) ⇒ HTTPPool
# File 'lib/rubygems/request/http_pool.rb', line 11
def initialize(http_args, cert_files, proxy_uri) @http_args = http_args @cert_files = cert_files @proxy_uri = proxy_uri @queue = Thread::SizedQueue.new 1 @queue << nil end
Instance Attribute Details
#cert_files (readonly)
[ GitHub ]# File 'lib/rubygems/request/http_pool.rb', line 9
attr_reader :cert_files, :proxy_uri
#proxy_uri (readonly)
[ GitHub ]# File 'lib/rubygems/request/http_pool.rb', line 9
attr_reader :cert_files, :proxy_uri
Instance Method Details
#checkin(connection)
[ GitHub ]# File 'lib/rubygems/request/http_pool.rb', line 23
def checkin(connection) @queue.push connection end
#checkout
[ GitHub ]# File 'lib/rubygems/request/http_pool.rb', line 19
def checkout @queue.pop || make_connection end
#close_all
[ GitHub ]# File 'lib/rubygems/request/http_pool.rb', line 27
def close_all until @queue.empty? if (connection = @queue.pop(true)) && connection.started? connection.finish end end @queue.push(nil) end
#make_connection (private)
[ GitHub ]# File 'lib/rubygems/request/http_pool.rb', line 38
def make_connection setup_connection Gem::Request::ConnectionPools.client.new(*@http_args) end
#setup_connection(connection) (private)
[ GitHub ]# File 'lib/rubygems/request/http_pool.rb', line 42
def setup_connection(connection) connection.start connection end