Method: Elastictastic::Rotor#initialize
- Defined in:
- lib/elastictastic/rotor.rb
#initialize(hosts, options) ⇒ Rotor
Returns a new instance of Rotor.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/elastictastic/rotor.rb', line 11 def initialize(hosts, ) = {} [:backoff_threshold, :backoff_start, :backoff_max].each do |key| [key] = .delete(key) end adapter = Adapter[.delete(:adapter)] @connections = hosts.map do |host| Node.new(adapter.new(host, ), ) end @head_index = 0 end |