Class: RailsEventSourcing::Dispatcher::ReactorSet
- Inherits:
-
Object
- Object
- RailsEventSourcing::Dispatcher::ReactorSet
- Defined in:
- lib/rails-event-sourcing/dispatcher.rb
Overview
Contains sync and async reactors. Used to:
-
store reactors via Rules#register
-
return a set of matching reactors with Rules#for
Instance Attribute Summary collapse
-
#async ⇒ Object
readonly
Returns the value of attribute async.
-
#sync ⇒ Object
readonly
Returns the value of attribute sync.
Instance Method Summary collapse
- #add_async(reactors) ⇒ Object
- #add_sync(reactors) ⇒ Object
-
#initialize ⇒ ReactorSet
constructor
A new instance of ReactorSet.
Constructor Details
#initialize ⇒ ReactorSet
Returns a new instance of ReactorSet.
69 70 71 72 |
# File 'lib/rails-event-sourcing/dispatcher.rb', line 69 def initialize @sync = Set.new @async = Set.new end |
Instance Attribute Details
#async ⇒ Object (readonly)
Returns the value of attribute async.
67 68 69 |
# File 'lib/rails-event-sourcing/dispatcher.rb', line 67 def async @async end |
#sync ⇒ Object (readonly)
Returns the value of attribute sync.
67 68 69 |
# File 'lib/rails-event-sourcing/dispatcher.rb', line 67 def sync @sync end |
Instance Method Details
#add_async(reactors) ⇒ Object
78 79 80 |
# File 'lib/rails-event-sourcing/dispatcher.rb', line 78 def add_async(reactors) @async += reactors end |
#add_sync(reactors) ⇒ Object
74 75 76 |
# File 'lib/rails-event-sourcing/dispatcher.rb', line 74 def add_sync(reactors) @sync += reactors end |