Class: Dynamoid::AdapterPlugin::AwsSdkV3::Middleware::Backoff

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamoid/adapter_plugin/aws_sdk_v3/middleware/backoff.rb

Instance Method Summary collapse

Constructor Details

#initialize(next_chain) ⇒ Backoff

Returns a new instance of Backoff.


9
10
11
12
# File 'lib/dynamoid/adapter_plugin/aws_sdk_v3/middleware/backoff.rb', line 9

def initialize(next_chain)
  @next_chain = next_chain
  @backoff = Dynamoid.config.backoff ? Dynamoid.config.build_backoff : nil
end

Instance Method Details

#call(request) ⇒ Object


14
15
16
17
18
19
# File 'lib/dynamoid/adapter_plugin/aws_sdk_v3/middleware/backoff.rb', line 14

def call(request)
  response = @next_chain.call(request)
  @backoff.call if @backoff

  response
end