Class: ActiveRecord::ConnectionAdapters::ConnectionPool

Inherits:
Object
  • Object
show all
Defined in:
lib/em-synchrony/activerecord.rb

Instance Method Summary collapse

Instance Method Details

#_fibered_mutexObject


16
17
18
# File 'lib/em-synchrony/activerecord.rb', line 16

def _fibered_mutex
  @fibered_mutex ||= EM::Synchrony::Thread::Mutex.new
end

#connectionObject


10
11
12
13
14
# File 'lib/em-synchrony/activerecord.rb', line 10

def connection
  _fibered_mutex.synchronize do
    @reserved_connections[current_connection_id] ||= checkout
  end
end