File: nil_cache.rb

package info (click to toggle)
ruby-sshkit 1.21.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 700 kB
  • sloc: ruby: 3,522; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 274 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# A cache that holds no connections. Any connection provided to this cache
# is simply closed.
SSHKit::Backend::ConnectionPool::NilCache = Struct.new(:closer) do
  def pop
    nil
  end

  def push(conn)
    closer.call(conn)
  end

  def same_key?(_key)
    true
  end
end