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