Method: Bundler::ConnectionPool#checkout

Defined in:
lib/bundler/vendor/connection_pool/lib/connection_pool.rb

#checkout(options = {}) ⇒ Object



119
120
121
122
123
124
125
126
127
# File 'lib/bundler/vendor/connection_pool/lib/connection_pool.rb', line 119

def checkout(options = {})
  if ::Thread.current[@key]
    ::Thread.current[@key_count] += 1
    ::Thread.current[@key]
  else
    ::Thread.current[@key_count] = 1
    ::Thread.current[@key] = @available.pop(options[:timeout] || @timeout)
  end
end