class Upperkut::Strategies::Base

Public Instance Methods

ack(_items) click to toggle source

Public: Confirms that items have been processed successfully.

items - The Array of items do be confirmed.

# File lib/upperkut/strategies/base.rb, line 30
def ack(_items)
  raise NotImplementedError
end
clear() click to toggle source

Public: Clear all data related to the strategy.

# File lib/upperkut/strategies/base.rb, line 23
def clear
  raise NotImplementedError
end
fetch_items(_batch_size) click to toggle source

Public: Retrieve events from Strategy.

batch_size: # of items to be retrieved.

Returns an Array containing events as hash.

# File lib/upperkut/strategies/base.rb, line 18
def fetch_items(_batch_size)
  raise NotImplementedError
end
metrics() click to toggle source

Public: Consolidated strategy metrics.

Returns hash containing metric name and values.

# File lib/upperkut/strategies/base.rb, line 51
def metrics
  raise NotImplementedError
end
nack(_items) click to toggle source

Public: Informs that items have been not processed successfully and therefore must be re-processed.

items - The Array of items do be unacknowledged.

# File lib/upperkut/strategies/base.rb, line 37
def nack(_items)
  raise NotImplementedError
end
process?() click to toggle source

Public: Tells when to execute the event processing, when this condition is met so the events are dispatched to the worker.

# File lib/upperkut/strategies/base.rb, line 44
def process?
  raise NotImplementedError
end
push_items(_items = []) click to toggle source

Public: Ingests the event into strategy.

items - The Array of items do be inserted.

Returns true when success, raise when error.

# File lib/upperkut/strategies/base.rb, line 9
def push_items(_items = [])
  raise NotImplementedError
end