Class: Cassandra::Reconnection::Policies::Constant

Inherits:
Cassandra::Reconnection::Policy show all
Defined in:
lib/cassandra/reconnection/policies/constant.rb

Overview

A reconnection policy that returns a constant reconnection interval

Instance Method Summary collapse

Constructor Details

#initialize(interval) ⇒ Constant

Returns a new instance of Constant.

Parameters:

  • interval (Numeric)

    reconnection interval (in seconds)



36
37
38
# File 'lib/cassandra/reconnection/policies/constant.rb', line 36

def initialize(interval)
  @schedule = Schedule.new(Float(interval))
end

Instance Method Details

#scheduleCassandra::Reconnection::Schedule

Returns reconnection schedule with constant interval.

Returns:



42
43
44
# File 'lib/cassandra/reconnection/policies/constant.rb', line 42

def schedule
  @schedule
end