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


24
25
26
# File 'lib/em-synchrony/activerecord.rb', line 24

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

#connectionObject


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

def connection
  _fibered_mutex.synchronize do
    @thread_cached_conns[connection_cache_key(Thread.current)] ||= checkout
  end
end