Module: Nutcracker

Defined in:
lib/nutcracker.rb,
lib/nutcracker/version.rb

Defined Under Namespace

Classes: Wrapper

Constant Summary collapse

VERSION =
"0.4.1.23"

Class Method Summary collapse

Class Method Details

.attach(options) ⇒ Wrapper

Connect to a running instance of Nutcracker ( see Nutcracker::Wrapper#initialize )

Examples:

Nutcracker.attach :config_file: 'conf/nutcracker.yaml', :stats_port => 22222

Returns:

  • (Wrapper)

    Nutcracker process wrapper



22
23
24
# File 'lib/nutcracker.rb', line 22

def self.attach options
  Nutcracker::Wrapper.new options.merge attached: true
end

.executableObject

Returns the Nutcracker executable path that is embeded with the gem



27
28
29
# File 'lib/nutcracker.rb', line 27

def self.executable
  File.expand_path("../../ext/nutcracker/src/nutcracker", __FILE__)
end

.start(options) ⇒ Wrapper

Syntactic sugar for launching the Nutcracker service ( see Nutcracker::Wrapper#initialize )

Examples:

Nutcracker.start config_file: 'conf/nutcracker.yaml'

Returns:

  • (Wrapper)

    Nutcracker process wrapper



14
15
16
# File 'lib/nutcracker.rb', line 14

def self.start options
  Nutcracker::Wrapper.new(options).start
end

.versionObject

Returns the version string



32
33
34
# File 'lib/nutcracker.rb', line 32

def self.version
  Nutcracker::VERSION
end