Class: ActiveEvent::EventSourceServer
- Inherits:
-
Object
- Object
- ActiveEvent::EventSourceServer
- Includes:
- Singleton
- Defined in:
- lib/active_event/event_source_server.rb
Defined Under Namespace
Classes: Status
Class Method Summary collapse
- .fail_on_projection_error(projection) ⇒ Object
- .wait_for_event_projection(event_id, projection, options = {}) ⇒ Object
Instance Method Summary collapse
- #fail_on_projection_error(projection) ⇒ Object
- #wait_for_event_projection(event_id, projection, options = {}) ⇒ Object
Class Method Details
.fail_on_projection_error(projection) ⇒ Object
20 21 22 |
# File 'lib/active_event/event_source_server.rb', line 20 def fail_on_projection_error(projection) instance.fail_on_projection_error(projection) end |
.wait_for_event_projection(event_id, projection, options = {}) ⇒ Object
16 17 18 |
# File 'lib/active_event/event_source_server.rb', line 16 def wait_for_event_projection(event_id, projection, = {}) instance.wait_for_event_projection(event_id, projection, ) end |
Instance Method Details
#fail_on_projection_error(projection) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/active_event/event_source_server.rb', line 34 def fail_on_projection_error(projection) mutex.synchronize do projection_status = status[projection] projection_status.fail_on_error end end |
#wait_for_event_projection(event_id, projection, options = {}) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/active_event/event_source_server.rb', line 25 def wait_for_event_projection(event_id, projection, = {}) mutex.synchronize do projection_status = status[projection] projection_status.fail_on_error # projection will not continue if error occurred projection_status.waiter(event_id).wait(mutex, [:timeout]) projection_status.fail_on_error end end |