class Dalli::Elasticache::AutoDiscovery::ConfigCommand

Encapsulates execution of the ‘config’ command, which is used to extract the list of nodes and determine if that list of nodes has changed.

Constants

CONFIG_COMMAND
LEGACY_CONFIG_COMMAND

Legacy command for version < 1.4.14

Attributes

engine_version[R]

Public Class Methods

new(host, port, engine_version) click to toggle source
# File lib/dalli/elasticache/auto_discovery/config_command.rb, line 18
def initialize(host, port, engine_version)
  super(host, port)
  @engine_version = engine_version
end

Public Instance Methods

command() click to toggle source
# File lib/dalli/elasticache/auto_discovery/config_command.rb, line 27
def command
  return LEGACY_CONFIG_COMMAND if legacy_config?

  CONFIG_COMMAND
end
legacy_config?() click to toggle source
# File lib/dalli/elasticache/auto_discovery/config_command.rb, line 33
def legacy_config?
  return false unless engine_version
  return false if engine_version.casecmp('unknown').zero?

  Gem::Version.new(engine_version) < Gem::Version.new('1.4.14')
rescue ArgumentError
  # Just assume false if we can't parse the engine_version
  false
end
response() click to toggle source
# File lib/dalli/elasticache/auto_discovery/config_command.rb, line 23
def response
  ConfigResponse.new(send_command)
end