module EM::Synchrony::ActiveRecord::Adapter

Public Instance Methods

add_transaction_record(record) click to toggle source

Register a record with the current transaction so that its after_commit and after_rollback callbacks can be called.

# File lib/em-synchrony/activerecord.rb, line 105
def add_transaction_record(record)
  current_transaction.add_record(record)
end
configure_connection() click to toggle source
# File lib/em-synchrony/activerecord.rb, line 52
def configure_connection
  nil
end
decrement_open_transactions() click to toggle source
# File lib/em-synchrony/activerecord.rb, line 74
def decrement_open_transactions
  real_connection.open_transactions -= 1
end
increment_open_transactions() click to toggle source
# File lib/em-synchrony/activerecord.rb, line 70
def increment_open_transactions
  real_connection.open_transactions += 1
end
open_transactions() click to toggle source
# File lib/em-synchrony/activerecord.rb, line 66
def open_transactions
  real_connection.open_transactions
end
real_connection() click to toggle source
# File lib/em-synchrony/activerecord.rb, line 62
def real_connection
  @connection.connection
end
transaction(*args, &blk) click to toggle source
Calls superclass method
# File lib/em-synchrony/activerecord.rb, line 56
def transaction(*args, &blk)
  @connection.execute(false) do |conn|
    super
  end
end
transaction_open?() click to toggle source
# File lib/em-synchrony/activerecord.rb, line 82
def transaction_open?
  current_transaction.open?
end

Protected Instance Methods

set_current_transaction(t) click to toggle source
# File lib/em-synchrony/activerecord.rb, line 111
def set_current_transaction(t)
  if t == @closed_transaction
    @transaction.delete(Fiber.current.object_id)
  else
    @transaction[Fiber.current.object_id] = t
  end
end