class Elasticsearch::Transport::Transport::Connections::Selector::Random

“Random connection” selector strategy.

Public Instance Methods

select(options={}) click to toggle source

Returns a random connection from the collection.

@return [Connections::Connection]

# File lib/elasticsearch/transport/transport/connections/selector.rb, line 37
def select(options={})
  connections.to_a.send( defined?(RUBY_VERSION) && RUBY_VERSION > '1.9' ? :sample : :choice)
end