# File lib/sshkit/backends/connection_pool.rb, line 16 def create_or_reuse_connection(*new_connection_args, &block) # Optimization: completely bypass the pool if idle_timeout is zero. return yield(*new_connection_args) if idle_timeout == 0 key = new_connection_args.to_s entry = find_and_reject_invalid(key) { |e| e.expired? || e.closed? } if entry.nil? entry = store_entry(key, yield(*new_connection_args)) end entry.expires_at = Time.now + idle_timeout if idle_timeout entry.connection end
Generated with the Darkfish Rdoc Generator 2.