Class: Akasha::Storage::HttpEventStore::ProjectionManager
- Inherits:
-
Object
- Object
- Akasha::Storage::HttpEventStore::ProjectionManager
- Defined in:
- lib/akasha/storage/http_event_store/projection_manager.rb
Overview
Manages HTTP ES projections.
Instance Method Summary collapse
-
#initialize(client) ⇒ ProjectionManager
constructor
A new instance of ProjectionManager.
-
#merge_all_by_event(name, event_names) ⇒ Object
Merges all streams into one, filtering the resulting stream so it only contains events with the specified names, using a projection.
Constructor Details
#initialize(client) ⇒ ProjectionManager
Returns a new instance of ProjectionManager.
6 7 8 |
# File 'lib/akasha/storage/http_event_store/projection_manager.rb', line 6 def initialize(client) @client = client end |
Instance Method Details
#merge_all_by_event(name, event_names) ⇒ Object
Merges all streams into one, filtering the resulting stream so it only contains events with the specified names, using a projection.
Arguments:
`name` - name of the projection stream
`event_names` - array of event names
17 18 19 20 |
# File 'lib/akasha/storage/http_event_store/projection_manager.rb', line 17 def merge_all_by_event(name, event_names) attempt_create_projection(name, event_names) || update_projection(name, event_names) end |