Module: Elastic::Transport::Transport::Connections::Selector::Base Abstract

Included in:
Random, RoundRobin
Defined in:
lib/elastic/transport/transport/connections/selector.rb

Overview

This module is abstract.

Common functionality for connection selector implementations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#connectionsObject (readonly)

Returns the value of attribute connections.



26
27
28
# File 'lib/elastic/transport/transport/connections/selector.rb', line 26

def connections
  @connections
end

Instance Method Details

#initialize(arguments = {}) ⇒ Object

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):



30
31
32
# File 'lib/elastic/transport/transport/connections/selector.rb', line 30

def initialize(arguments={})
  @connections = arguments[:connections]
end

#select(options = {}) ⇒ Connection

This method is abstract.

Selector strategies implement this method to select and return a connection from the pool.

Returns:

Raises:

  • (NoMethodError)


39
40
41
# File 'lib/elastic/transport/transport/connections/selector.rb', line 39

def select(options={})
  raise NoMethodError, "Implement this method in the selector implementation."
end