Class: BitGirder::Concurrent::Retry::Builder
- Inherits:
-
Object
- Object
- BitGirder::Concurrent::Retry::Builder
- Defined in:
- lib/bitgirder/concurrent.rb
Instance Attribute Summary collapse
-
#retries ⇒ Object
Returns the value of attribute retries.
-
#seed_secs ⇒ Object
Returns the value of attribute seed_secs.
Instance Method Summary collapse
-
#initialize ⇒ Builder
constructor
A new instance of Builder.
- #retry_on(*argv, &blk) ⇒ Object
Constructor Details
#initialize ⇒ Builder
Returns a new instance of Builder.
180 181 182 183 184 185 186 187 |
# File 'lib/bitgirder/concurrent.rb', line 180 def initialize # Set defaults @retries = 3 @seed_secs = 1.0 @failed = lambda { |err| raise err } @retry_on = [ Exception ] end |
Instance Attribute Details
#retries ⇒ Object
Returns the value of attribute retries.
178 179 180 |
# File 'lib/bitgirder/concurrent.rb', line 178 def retries @retries end |
#seed_secs ⇒ Object
Returns the value of attribute seed_secs.
178 179 180 |
# File 'lib/bitgirder/concurrent.rb', line 178 def seed_secs @seed_secs end |
Instance Method Details
#retry_on(*argv, &blk) ⇒ Object
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/bitgirder/concurrent.rb', line 200 def retry_on( *argv, &blk ) if blk if argv.empty? @retry_on = blk else raise "Can't combine block and rescue target list" end else if argv.empty? raise "Need at least one rescue target" else @retry_on = Array.new( argv ) end end end |