class Elastic::Transport::Transport::Connections::Selector::RoundRobin
“Round-robin” selector strategy (default).
def initialize(arguments = {})
(**arguments)-
:connections(Connections::Collection) -- Collection with connections.
def initialize(arguments = {}) super @mutex = Mutex.new @current = nil end
def select(options={})
-
(Connections::Connection)-
def select(options={}) @mutex.synchronize do conns = connections if @current && (@current < conns.size-1) @current += 1 else @current = 0 end conns[@current] end end