Class: Nervion::ReconnectionScheduler
- Inherits:
-
Object
- Object
- Nervion::ReconnectionScheduler
- Defined in:
- lib/nervion/reconnection_scheduler.rb
Constant Summary collapse
- HTTP_ERROR_LIMIT =
10
- NETWORK_ERROR_LIMIT =
65
Instance Method Summary collapse
-
#initialize ⇒ ReconnectionScheduler
constructor
A new instance of ReconnectionScheduler.
- #reconnect_after_http_error_in(stream) ⇒ Object
- #reconnect_after_network_error_in(stream) ⇒ Object
Constructor Details
#initialize ⇒ ReconnectionScheduler
Returns a new instance of ReconnectionScheduler.
8 9 10 11 12 13 |
# File 'lib/nervion/reconnection_scheduler.rb', line 8 def initialize @http_errors = ErrorCounter.new(HTTP_ERROR_LIMIT) @network_errors = ErrorCounter.new(NETWORK_ERROR_LIMIT) @http_wait_calculator = HttpWaitCalculator.new @network_wait_calculator = NetworkWaitCalculator.new end |
Instance Method Details
#reconnect_after_http_error_in(stream) ⇒ Object
15 16 17 |
# File 'lib/nervion/reconnection_scheduler.rb', line 15 def reconnect_after_http_error_in(stream) reconnect_after_error stream, @http_errors, @http_wait_calculator end |
#reconnect_after_network_error_in(stream) ⇒ Object
19 20 21 |
# File 'lib/nervion/reconnection_scheduler.rb', line 19 def reconnect_after_network_error_in(stream) reconnect_after_error stream, @network_errors, @network_wait_calculator end |