Module: Hoof
- Defined in:
- lib/hoof.rb,
lib/hoof/cli.rb,
lib/hoof/application.rb,
lib/hoof/http_server.rb,
lib/hoof/control_server.rb,
lib/hoof/application_pool.rb
Defined Under Namespace
Classes: Application, ApplicationPool, Cli, ControlServer, HttpServer
Class Method Summary
collapse
Class Method Details
.find(name) ⇒ Object
20
21
22
|
# File 'lib/hoof.rb', line 20
def self.find name
pool[name]
end
|
.http_port ⇒ Object
45
46
47
|
# File 'lib/hoof.rb', line 45
def self.http_port
26080
end
|
.https_port ⇒ Object
49
50
51
|
# File 'lib/hoof.rb', line 49
def self.https_port
26443
end
|
.pool ⇒ Object
12
13
14
15
16
17
18
|
# File 'lib/hoof.rb', line 12
def self.pool
@pool ||= begin
app_pool = Hoof::ApplicationPool.new
app_pool.reload
app_pool
end
end
|
.sock ⇒ Object
41
42
43
|
# File 'lib/hoof.rb', line 41
def self.sock
'/tmp/hoof.sock'
end
|
.start ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/hoof.rb', line 24
def self.start
EventMachine.epoll
EventMachine::run do
trap("TERM") { stop }
trap("INT") { stop }
EventMachine::start_server "127.0.0.1", http_port, Hoof::HttpServer
EventMachine::start_server "127.0.0.1", https_port, Hoof::HttpServer
EventMachine::start_server sock, Hoof::ControlServer
end
end
|
.stop ⇒ Object
36
37
38
39
|
# File 'lib/hoof.rb', line 36
def self.stop
pool.stop
EventMachine.stop
end
|