Class: Que::Adapters::ActiveRecord
- Defined in:
- lib/que/adapters/active_record.rb
Defined Under Namespace
Classes: TransactionCallback
Instance Method Summary collapse
Methods inherited from Base
#execute, #in_transaction?, #initialize
Constructor Details
This class inherits a constructor from Que::Adapters::Base
Instance Method Details
#checkout ⇒ Object
4 5 6 |
# File 'lib/que/adapters/active_record.rb', line 4 def checkout checkout_activerecord_adapter { |conn| yield conn.raw_connection } end |
#wake_worker_after_commit ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/que/adapters/active_record.rb', line 8 def wake_worker_after_commit # Works with ActiveRecord 3.2 and 4 (possibly earlier, didn't check) if in_transaction? checkout_activerecord_adapter { |adapter| adapter.add_transaction_record(TransactionCallback.new) } else Que.wake! end end |