Module: EasyRetry
- Defined in:
- lib/easy_retry.rb,
lib/easy_retry/version.rb,
lib/easy_retry/configuration.rb
Overview
EasyRetry core module
Defined Under Namespace
Classes: Configuration
Constant Summary collapse
- VERSION =
'1.0.8.1'
Class Method Summary collapse
- .configuration ⇒ Object
- .configure {|configuration| ... } ⇒ Object
- .delay_algorithm ⇒ Object
- .delay_options ⇒ Object
- .logger ⇒ Object
Class Method Details
.configuration ⇒ Object
10 11 12 |
# File 'lib/easy_retry.rb', line 10 def configuration @configuration ||= EasyRetry::Configuration.new end |
.configure {|configuration| ... } ⇒ Object
14 15 16 |
# File 'lib/easy_retry.rb', line 14 def configure yield(configuration) end |
.delay_algorithm ⇒ Object
22 23 24 |
# File 'lib/easy_retry.rb', line 22 def delay_algorithm configuration.delay_algorithm end |
.delay_options ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/easy_retry.rb', line 26 def { none: ->(_try_number) {}, by_try: ->(try_number) { sleep try_number }, default: ->(try_number) { sleep try_number * try_number }, exponential: ->(try_number) { sleep 2**try_number } } end |
.logger ⇒ Object
18 19 20 |
# File 'lib/easy_retry.rb', line 18 def logger configuration.logger end |