class Elastic::Transport::Transport::Connections::Selector::RoundRobin


“Round-robin” selector strategy (default).

def initialize(arguments = {})

Options Hash: (**arguments)
  • :connections (Connections::Collection) -- Collection with connections.
def initialize(arguments = {})
  super
  @mutex = Mutex.new
  @current = nil
end

def select(options={})

Returns:
  • (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