Class: OpenSearch::Transport::Transport::Connections::Selector::Random
- Inherits:
-
Object
- Object
- OpenSearch::Transport::Transport::Connections::Selector::Random
- Includes:
- Base
- Defined in:
- lib/opensearch/transport/transport/connections/selector.rb
Overview
“Random connection” selector strategy.
Instance Attribute Summary
Attributes included from Base
Instance Method Summary collapse
-
#select(_options = {}) ⇒ Connections::Connection
Returns a random connection from the collection.
Methods included from Base
Instance Method Details
#select(_options = {}) ⇒ Connections::Connection
Returns a random connection from the collection.
62 63 64 |
# File 'lib/opensearch/transport/transport/connections/selector.rb', line 62 def select( = {}) connections.to_a.send(defined?(RUBY_VERSION) && RUBY_VERSION > '1.9' ? :sample : :choice) end |