Class: Puppet::Network::HTTP::NoCachePool Private
- Defined in:
- lib/puppet/network/http/nocache_pool.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A pool that does not cache HTTP connections.
Instance Method Summary collapse
- #close ⇒ Object private
-
#initialize(factory = Puppet::Network::HTTP::Factory.new) ⇒ NoCachePool
constructor
private
A new instance of NoCachePool.
-
#with_connection(site, verifier) {|http| ... } ⇒ Object
private
Yields a
Net::HTTP
connection.
Methods inherited from BasePool
Constructor Details
#initialize(factory = Puppet::Network::HTTP::Factory.new) ⇒ NoCachePool
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of NoCachePool.
5 6 7 8 |
# File 'lib/puppet/network/http/nocache_pool.rb', line 5 def initialize(factory = Puppet::Network::HTTP::Factory.new) Puppet.deprecation_warning(_('Puppet::Network::HTTP::NoCachePool is deprecated.')) @factory = factory end |
Instance Method Details
#close ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 |
# File 'lib/puppet/network/http/nocache_pool.rb', line 25 def close # do nothing end |
#with_connection(site, verifier) {|http| ... } ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Yields a Net::HTTP
connection.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/puppet/network/http/nocache_pool.rb', line 13 def with_connection(site, verifier, &block) http = @factory.create_connection(site) start(site, verifier, http) begin yield http ensure return unless http.started? Puppet.debug("Closing connection for #{site}") http.finish end end |