Class: ElasticSearch::TransportBase

Inherits:
Object
  • Object
show all
Defined in:
lib/elastic_search/transport/base.rb

Direct Known Subclasses

HTTPTransport, ThriftTransport

Instance Method Summary collapse

Constructor Details

#initialize(hosts, options = {}) ⇒ TransportBase

Returns a new instance of TransportBase.



3
4
5
6
# File 'lib/elastic_search/transport/base.rb', line 3

def initialize(hosts, options = {})
  @options = options
  @connections =  hosts.collect { |host| get_connection(host) }
end

Instance Method Details

#current_connectionObject



8
9
10
# File 'lib/elastic_search/transport/base.rb', line 8

def current_connection
  @connections.sample
end

#execute(request) ⇒ Object

Raises:



12
13
14
# File 'lib/elastic_search/transport/base.rb', line 12

def execute(request)
  raise NotImplementedError
end