Class: Elastic::Transport::Transport::Connections::Selector::Random
- Inherits:
-
Object
- Object
- Elastic::Transport::Transport::Connections::Selector::Random
- Includes:
- Base
- Defined in:
- lib/elastic/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.
53 54 55 |
# File 'lib/elastic/transport/transport/connections/selector.rb', line 53 def select(={}) connections.to_a.sample end |