Class: Droonga::Command::DroongaEngineService

Inherits:
Object
  • Object
show all
Includes:
Loggable
Defined in:
lib/droonga/command/droonga_engine_service.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDroongaEngineService

Returns a new instance of DroongaEngineService.



38
39
40
41
42
43
44
45
46
# File 'lib/droonga/command/droonga_engine_service.rb', line 38

def initialize
  @engine_name = nil
  @internal_connection_lifetime = nil
  @listen_fd = nil
  @heartbeat_fd = nil
  @contrtol_read_fd = nil
  @contrtol_write_fd = nil
  @contrtol_write_closed = false
end

Class Method Details

.run(command_line_arguments) ⇒ Object



31
32
33
# File 'lib/droonga/command/droonga_engine_service.rb', line 31

def run(command_line_arguments)
  new.run(command_line_arguments)
end

Instance Method Details

#run(command_line_arguments) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/droonga/command/droonga_engine_service.rb', line 48

def run(command_line_arguments)
  create_new_process_group

  parse_command_line_arguments!(command_line_arguments)
  PluginLoader.load_all

  control_write_io = IO.new(@control_write_fd)
  success = true
  begin
    run_services
  rescue
    logger.exception("failed to run services", $!)
    success = false
  ensure
    shutdown_worker_process_agent
  end

  success
end