Class: ServerEngine::EmbeddedServer

Inherits:
Server
  • Object
show all
Defined in:
lib/serverengine/embedded_server.rb

Instance Attribute Summary

Attributes included from ConfigLoader

#config, #logger

Instance Method Summary collapse

Methods inherited from Server

#after_run, #after_start, #before_run, #dump, #initialize, #install_signal_handlers, #main

Methods included from ConfigLoader

#initialize, #reload_config

Constructor Details

This class inherits a constructor from ServerEngine::Server

Instance Method Details

#reloadObject



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/serverengine/embedded_server.rb', line 54

def reload
  super
  Thread.new do
    begin
      @worker.reload
    rescue => e
      ServerEngine.dump_uncaught_error(e)
    end
  end
  nil
end

#restart(stop_graceful) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/serverengine/embedded_server.rb', line 42

def restart(stop_graceful)
  super
  Thread.new do
    begin
      @worker.stop
    rescue => e
      ServerEngine.dump_uncaught_error(e)
    end
  end
  nil
end

#runObject



23
24
25
26
27
28
# File 'lib/serverengine/embedded_server.rb', line 23

def run
  @worker = create_worker(0)
  until @stop
    @worker.main
  end
end

#stop(stop_graceful) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/serverengine/embedded_server.rb', line 30

def stop(stop_graceful)
  super
  Thread.new do
    begin
      @worker.stop
    rescue => e
      ServerEngine.dump_uncaught_error(e)
    end
  end
  nil
end