MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / acquire

Method acquire

tests/fixtures/sample.rb:81–89  ·  view source on GitHub ↗

Acquires a connection from the pool.

Source from the content-addressed store, hash-verified

79
80 # Acquires a connection from the pool.
81 def acquire
82 if @connections.empty?
83 conn = Connection.new(@host)
84 conn.connect
85 conn
86 else
87 @connections.pop
88 end
89 end
90
91 def release(conn)
92 @connections.push(conn)

Callers

nothing calls this directly

Calls 2

newMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected