Class: RailsEventStore::AfterCommitAsyncDispatcher::AsyncRecord
- Inherits:
-
Object
- Object
- RailsEventStore::AfterCommitAsyncDispatcher::AsyncRecord
- Defined in:
- lib/rails_event_store/after_commit_async_dispatcher.rb
Instance Attribute Summary collapse
-
#dispatcher ⇒ Object
readonly
Returns the value of attribute dispatcher.
-
#schedule_proc ⇒ Object
readonly
Returns the value of attribute schedule_proc.
Instance Method Summary collapse
- #add_to_transaction ⇒ Object
- #before_committed! ⇒ Object
- #committed! ⇒ Object
-
#initialize(dispatcher, schedule_proc) ⇒ AsyncRecord
constructor
A new instance of AsyncRecord.
- #rolledback! ⇒ Object
- #trigger_transactional_callbacks? ⇒ Boolean
Constructor Details
#initialize(dispatcher, schedule_proc) ⇒ AsyncRecord
Returns a new instance of AsyncRecord.
32 33 34 35 |
# File 'lib/rails_event_store/after_commit_async_dispatcher.rb', line 32 def initialize(dispatcher, schedule_proc) @dispatcher = dispatcher @schedule_proc = schedule_proc end |
Instance Attribute Details
#dispatcher ⇒ Object (readonly)
Returns the value of attribute dispatcher.
51 52 53 |
# File 'lib/rails_event_store/after_commit_async_dispatcher.rb', line 51 def dispatcher @dispatcher end |
#schedule_proc ⇒ Object (readonly)
Returns the value of attribute schedule_proc.
51 52 53 |
# File 'lib/rails_event_store/after_commit_async_dispatcher.rb', line 51 def schedule_proc @schedule_proc end |
Instance Method Details
#add_to_transaction ⇒ Object
45 46 47 |
# File 'lib/rails_event_store/after_commit_async_dispatcher.rb', line 45 def add_to_transaction dispatcher.run(&schedule_proc) end |
#before_committed! ⇒ Object
43 |
# File 'lib/rails_event_store/after_commit_async_dispatcher.rb', line 43 def before_committed!; end |
#committed! ⇒ Object
37 38 39 |
# File 'lib/rails_event_store/after_commit_async_dispatcher.rb', line 37 def committed!(*) schedule_proc.call end |
#rolledback! ⇒ Object
41 |
# File 'lib/rails_event_store/after_commit_async_dispatcher.rb', line 41 def rolledback!(*); end |
#trigger_transactional_callbacks? ⇒ Boolean
49 |
# File 'lib/rails_event_store/after_commit_async_dispatcher.rb', line 49 def trigger_transactional_callbacks?; end |