Class: Aws::Plugins::RetryErrors Private

Inherits:
Seahorse::Client::Plugin show all
Defined in:
lib/aws-sdk-core/plugins/retry_errors.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Classes: ErrorInspector, Handler

Constant Summary collapse

EQUAL_JITTER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

lambda { |delay| (delay / 2) + Kernel.rand(0..(delay/2))}
FULL_JITTER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

lambda { |delay| Kernel.rand(0..delay) }
NO_JITTER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

lambda { |delay| delay }
JITTERS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{
  none: NO_JITTER,
  equal: EQUAL_JITTER,
  full: FULL_JITTER
}
DEFAULT_BACKOFF =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

lambda do |c|
  delay = 2 ** c.retries * c.config.retry_base_delay
  delay = [delay, c.config.retry_max_delay].min if (c.config.retry_max_delay || 0) > 0
  jitter = c.config.retry_jitter
  jitter = JITTERS[jitter] if Symbol === jitter
  delay = jitter.call(delay) if jitter
  Kernel.sleep(delay)
end

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Plugin

#add_options, #after_initialize, after_initialize, after_initialize_hooks, before_initialize, #before_initialize, before_initialize_hooks, handlers, literal, option, options

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response, #handler_for, #new_handler

Instance Method Details

#add_handlers(handlers, config) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



226
227
228
229
230
# File 'lib/aws-sdk-core/plugins/retry_errors.rb', line 226

def add_handlers(handlers, config)
  if config.retry_limit > 0
    handlers.add(Handler, step: :sign, priority: 99)
  end
end