lib/never_block/pool/fibered_connection_pool.rb
# Can we find a connection?
# Can we create one?
# Wait in the queue then
Can we find a connection.
Can we create one.
Wait in the queue then
Can we find a connection . Can we create one . Wait in the queue then
def acquire(fiber)
				if !@connections.empty?
					@busy_connections[fiber] = @connections.shift
				elsif (@connections.length + @busy_connections.length) < @size
					conn = @connection_proc.call
					@busy_connections[fiber] = conn
				else
					Fiber.yield @queue << fiber
				end
			end
def acquire ( fiber ) if ! @connections . empty? @busy_connections [ fiber ] = @connections . shift elsif ( @connections . length + @busy_connections . length ) < @size conn = @connection_proc . call @busy_connections [ fiber ] = conn else Fiber . yield @queue << fiber end end
Can we find a connection?
Can we find a connection?
fiber
<not_specific>