Class: RailsEventStore::AsyncProxyStrategy::AfterCommit::AsyncRecord
- Inherits:
-
Object
- Object
- RailsEventStore::AsyncProxyStrategy::AfterCommit::AsyncRecord
- Defined in:
- lib/rails_event_store/active_job_dispatcher.rb
Instance Method Summary collapse
- #add_to_transaction ⇒ Object
- #before_committed! ⇒ Object
- #committed! ⇒ Object
-
#initialize(klass, event) ⇒ AsyncRecord
constructor
A new instance of AsyncRecord.
- #rolledback! ⇒ Object
Constructor Details
#initialize(klass, event) ⇒ AsyncRecord
Returns a new instance of AsyncRecord.
19 20 21 22 |
# File 'lib/rails_event_store/active_job_dispatcher.rb', line 19 def initialize(klass, event) @klass = klass @event = event end |
Instance Method Details
#add_to_transaction ⇒ Object
34 35 36 |
# File 'lib/rails_event_store/active_job_dispatcher.rb', line 34 def add_to_transaction AfterCommit.new.call(@klass, @event) end |
#before_committed! ⇒ Object
31 32 |
# File 'lib/rails_event_store/active_job_dispatcher.rb', line 31 def before_committed! end |
#committed! ⇒ Object
24 25 26 |
# File 'lib/rails_event_store/active_job_dispatcher.rb', line 24 def committed! @klass.perform_later(YAML.dump(@event)) end |
#rolledback! ⇒ Object
28 29 |
# File 'lib/rails_event_store/active_job_dispatcher.rb', line 28 def rolledback!(*) end |