Class: Autoscaler::IgnoreScheduledAndRetrying

Inherits:
Object
  • Object
show all
Defined in:
lib/autoscaler/ignore_scheduled_and_retrying.rb

Overview

  • Strategy wrapper to ignore scheduled and retrying queues. Usage:

``new_strategy = IgnoreScheduledAndRetrying.new(my_old_strategy)``

Instance Method Summary collapse

Constructor Details

#initialize(strategy) ⇒ IgnoreScheduledAndRetrying



5
6
7
# File 'lib/autoscaler/ignore_scheduled_and_retrying.rb', line 5

def initialize(strategy)
  @strategy = strategy
end

Instance Method Details

#call(system, event_idle_time) ⇒ Integer



12
13
14
15
16
# File 'lib/autoscaler/ignore_scheduled_and_retrying.rb', line 12

def call(system, event_idle_time)
  system.define_singleton_method(:scheduled) { 0 }
  system.define_singleton_method(:retrying)  { 0 }
  @strategy.call(system, event_idle_time)
end