Module: ActiveRecord::ConnectionAdapters::ConnectionPool::RoundRobin

Defined in:
lib/active_record/round_robin.rb

Instance Method Summary collapse

Instance Method Details

#checkin(conn) ⇒ Object

when checking in a connection put it at the end of the connections array. this way all the connections get used



7
8
9
10
11
12
13
14
15
16
# File 'lib/active_record/round_robin.rb', line 7

def checkin(conn)
  @connection_mutex.synchronize do
    conn.send(:_run_checkin_callbacks) do
      @connections.delete conn
      @connections.push conn
      @checked_out.delete conn
      @queue.signal
    end
  end
end