Class: Elastictastic::Rotor::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/elastictastic/rotor.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection, options) ⇒ Node

Returns a new instance of Node.



48
49
50
51
52
53
54
# File 'lib/elastictastic/rotor.rb', line 48

def initialize(connection, options)
  @connection = connection
  @failures = 0
  @backoff_threshold = options[:backoff_threshold] || 0
  @backoff_start = options[:backoff_start]
  @backoff_max = options[:backoff_max]
end

Instance Method Details

#request(method, path, body = nil) ⇒ Object



56
57
58
# File 'lib/elastictastic/rotor.rb', line 56

def request(method, path, body = nil)
  try_track { @connection.request(method, path, body).tap { succeeded! }}
end