Class: Cassandra::Reconnection::Policies::Exponential
- Inherits:
-
Cassandra::Reconnection::Policy
- Object
- Cassandra::Reconnection::Policy
- Cassandra::Reconnection::Policies::Exponential
- Defined in:
- lib/cassandra/reconnection/policies/exponential.rb
Overview
A reconnection policy that returns a constant exponentially growing reconnection interval up to a given maximum
Instance Method Summary collapse
-
#initialize(start, max, exponent = 2) ⇒ Exponential
constructor
A new instance of Exponential.
-
#schedule ⇒ Cassandra::Reconnection::Schedule
An exponential reconnection schedule.
Constructor Details
#initialize(start, max, exponent = 2) ⇒ Exponential
Returns a new instance of Exponential.
65 66 67 68 69 |
# File 'lib/cassandra/reconnection/policies/exponential.rb', line 65 def initialize(start, max, exponent = 2) @start = start @max = max @exponent = exponent end |
Instance Method Details
#schedule ⇒ Cassandra::Reconnection::Schedule
Returns an exponential reconnection schedule.
73 74 75 |
# File 'lib/cassandra/reconnection/policies/exponential.rb', line 73 def schedule Schedule.new(@start, @max, @exponent) end |