Class: Rage::Configuration::Deferred::Backpressure
- Inherits:
-
Object
- Object
- Rage::Configuration::Deferred::Backpressure
- Defined in:
- lib/rage/configuration.rb
Instance Attribute Summary collapse
-
#high_water_mark ⇒ Object
readonly
Returns the value of attribute high_water_mark.
-
#low_water_mark ⇒ Object
readonly
Returns the value of attribute low_water_mark.
-
#sleep_interval ⇒ Object
readonly
Returns the value of attribute sleep_interval.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
-
#timeout_iterations ⇒ Object
readonly
Returns the value of attribute timeout_iterations.
Instance Method Summary collapse
-
#initialize(high_water_mark = nil, low_water_mark = nil, timeout = nil) ⇒ Backpressure
constructor
A new instance of Backpressure.
Constructor Details
#initialize(high_water_mark = nil, low_water_mark = nil, timeout = nil) ⇒ Backpressure
Returns a new instance of Backpressure.
425 426 427 428 429 430 431 432 |
# File 'lib/rage/configuration.rb', line 425 def initialize(high_water_mark = nil, low_water_mark = nil, timeout = nil) @high_water_mark = high_water_mark || 1_000 @low_water_mark = low_water_mark || (@high_water_mark * 0.8).round @timeout = timeout || 2 @sleep_interval = 0.05 @timeout_iterations = (@timeout / @sleep_interval).round end |
Instance Attribute Details
#high_water_mark ⇒ Object (readonly)
Returns the value of attribute high_water_mark.
423 424 425 |
# File 'lib/rage/configuration.rb', line 423 def high_water_mark @high_water_mark end |
#low_water_mark ⇒ Object (readonly)
Returns the value of attribute low_water_mark.
423 424 425 |
# File 'lib/rage/configuration.rb', line 423 def low_water_mark @low_water_mark end |
#sleep_interval ⇒ Object (readonly)
Returns the value of attribute sleep_interval.
423 424 425 |
# File 'lib/rage/configuration.rb', line 423 def sleep_interval @sleep_interval end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
423 424 425 |
# File 'lib/rage/configuration.rb', line 423 def timeout @timeout end |
#timeout_iterations ⇒ Object (readonly)
Returns the value of attribute timeout_iterations.
423 424 425 |
# File 'lib/rage/configuration.rb', line 423 def timeout_iterations @timeout_iterations end |