Class: Upperkut::Strategies::Base
- Inherits:
-
Object
- Object
- Upperkut::Strategies::Base
- Defined in:
- lib/upperkut/strategies/base.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#clear ⇒ Object
Public: Clear all data related to the strategy.
-
#fetch_items(_batch_size) ⇒ Object
Public: Retrieve events from Strategy.
-
#metrics ⇒ Object
Public: Consolidated strategy metrics.
-
#process? ⇒ Boolean
Public: Tells when to execute the event processing, when this condition is met so the events are dispatched to the worker.
-
#push_items(_items = []) ⇒ Object
Public: Ingests the event into strategy.
Instance Method Details
#clear ⇒ Object
Public: Clear all data related to the strategy.
23 24 25 |
# File 'lib/upperkut/strategies/base.rb', line 23 def clear raise NotImplementedError end |
#fetch_items(_batch_size) ⇒ Object
Public: Retrieve events from Strategy.
batch_size: # of items to be retrieved.
Returns an Array containing events as hash.
18 19 20 |
# File 'lib/upperkut/strategies/base.rb', line 18 def fetch_items(_batch_size) raise NotImplementedError end |
#metrics ⇒ Object
Public: Consolidated strategy metrics.
Returns hash containing metric name and values.
37 38 39 |
# File 'lib/upperkut/strategies/base.rb', line 37 def metrics raise NotImplementedError end |
#process? ⇒ Boolean
Public: Tells when to execute the event processing, when this condition is met so the events are dispatched to the worker.
30 31 32 |
# File 'lib/upperkut/strategies/base.rb', line 30 def process? raise NotImplementedError end |
#push_items(_items = []) ⇒ Object
Public: Ingests the event into strategy.
items - The Array of items do be inserted.
Returns true when success, raise when error.
9 10 11 |
# File 'lib/upperkut/strategies/base.rb', line 9 def push_items(_items = []) raise NotImplementedError end |