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, #recalc_next_time, #secondary?, #step

Constructor Details

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

Returns a new instance of PeriodicRetry.



201
202
203
204
205
206
207
# File 'lib/fluent/plugin_helper/retry_state.rb', line 201

def initialize(title, wait, timeout, forever, max_steps, randomize, randomize_width, secondary, secondary_threshold)
  @retry_wait = wait

  super(title, wait, timeout, forever, max_steps, randomize, randomize_width, secondary, secondary_threshold)

  @next_time = @start + @retry_wait
end

Instance Method Details

#calc_max_retry_timeout(max_steps) ⇒ Object



213
214
215
# File 'lib/fluent/plugin_helper/retry_state.rb', line 213

def calc_max_retry_timeout(max_steps)
  @retry_wait * max_steps
end

#naive_next_time(retry_next_times) ⇒ Object



209
210
211
# File 'lib/fluent/plugin_helper/retry_state.rb', line 209

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