Class: Upperkut::Strategies::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/upperkut/strategies/base.rb

Direct Known Subclasses

BufferedQueue, ScheduledQueue

Instance Method Summary collapse

Instance Method Details

#clearObject

Public: Clear all data related to the strategy.

Raises:

  • (NotImplementedError)


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.

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/upperkut/strategies/base.rb', line 18

def fetch_items(_batch_size)
  raise NotImplementedError
end

#metricsObject

Public: Consolidated strategy metrics.

Returns hash containing metric name and values.

Raises:

  • (NotImplementedError)


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.

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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.

Raises:

  • (NotImplementedError)


9
10
11
# File 'lib/upperkut/strategies/base.rb', line 9

def push_items(_items = [])
  raise NotImplementedError
end