# File lib/sshkit/backends/connection_pool.rb, line 25 def checkin(entry) entry.expires_at = Time.now + idle_timeout if idle_timeout @mutex.synchronize do @pool[entry.key] ||= [] @pool[entry.key] << entry end end
# File lib/sshkit/backends/connection_pool.rb, line 17 def checkout(*new_connection_args, &block) # Optimization: completely bypass the pool if idle_timeout is zero. key = new_connection_args.to_s return create_new_entry(new_connection_args, key, &block) if idle_timeout == 0 find_live_entry(key) || create_new_entry(new_connection_args, key, &block) end
Generated with the Darkfish Rdoc Generator 2.