Class: Fluent::PluginHelper::RetryState::PeriodicRetry

Inherits:
RetryStateMachine show all
Defined in:
lib/fluent/plugin_helper/retry_state.rb

Instance Attribute Summary

Attributes inherited from RetryStateMachine

#current, #next_time, #secondary_transition_at, #secondary_transition_steps, #start, #steps, #timeout_at, #title

Instance Method Summary collapse

Methods inherited from RetryStateMachine

#calc_next_time, #current_time, #limit?, #randomize, #secondary?, #step

Constructor Details

#initialize(title, wait, timeout, forever, max_steps, randomize, randomize_width, secondary, secondary_threathold) ⇒ PeriodicRetry

Returns a new instance of PeriodicRetry.



165
166
167
168
169
# File 'lib/fluent/plugin_helper/retry_state.rb', line 165

def initialize(title, wait, timeout, forever, max_steps, randomize, randomize_width, secondary, secondary_threathold)
  super(title, wait, timeout, forever, max_steps, randomize, randomize_width, secondary, secondary_threathold)
  @retry_wait = wait
  @next_time = @start + @retry_wait
end

Instance Method Details

#naive_next_time(retry_next_times) ⇒ Object



171
172
173
# File 'lib/fluent/plugin_helper/retry_state.rb', line 171

def naive_next_time(retry_next_times)
  current_time + randomize(@retry_wait)
end