Module: Fluent::PluginHelper::RetryState

Defined in:
lib/fluent/plugin_helper/retry_state.rb

Defined Under Namespace

Classes: ExponentialBackOffRetry, PeriodicRetry, RetryStateMachine

Instance Method Summary collapse

Instance Method Details

#retry_state_create(title, retry_type, wait, timeout, forever: false, max_steps: nil, backoff_base: 2, max_interval: nil, randomize: true, randomize_width: 0.125, secondary: false, secondary_threshold: 0.8) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fluent/plugin_helper/retry_state.rb', line 20

def retry_state_create(
    title, retry_type, wait, timeout,
    forever: false, max_steps: nil, backoff_base: 2, max_interval: nil, randomize: true, randomize_width: 0.125,
    secondary: false, secondary_threshold: 0.8
)
  case retry_type
  when :exponential_backoff
    ExponentialBackOffRetry.new(title, wait, timeout, forever, max_steps, randomize, randomize_width, backoff_base, max_interval, secondary, secondary_threshold)
  when :periodic
    PeriodicRetry.new(title, wait, timeout, forever, max_steps, randomize, randomize_width, secondary, secondary_threshold)
  else
    raise "BUG: unknown retry_type specified: '#{retry_type}'"
  end
end