Class: UpstartUnicornLauncher
- Inherits:
-
Object
- Object
- UpstartUnicornLauncher
- Defined in:
- lib/upstart_unicorn_launcher.rb,
lib/upstart_unicorn_launcher/version.rb
Constant Summary collapse
- VERSION =
"0.0.4"
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#pidfile ⇒ Object
Returns the value of attribute pidfile.
-
#restarting ⇒ Object
Returns the value of attribute restarting.
-
#startup_period ⇒ Object
Returns the value of attribute startup_period.
-
#tick_period ⇒ Object
Returns the value of attribute tick_period.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
-
#initialize(command, options = {}) ⇒ UpstartUnicornLauncher
constructor
A new instance of UpstartUnicornLauncher.
- #start ⇒ Object
Constructor Details
#initialize(command, options = {}) ⇒ UpstartUnicornLauncher
Returns a new instance of UpstartUnicornLauncher.
6 7 8 9 10 11 12 |
# File 'lib/upstart_unicorn_launcher.rb', line 6 def initialize(command, = {}) self.command = command self.pidfile = File.([:pidfile] || 'unicorn.pid') self.startup_period = [:startup] || 60 self.tick_period = [:tick] || 0.1 self.verbose = [:verbose] || false end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
4 5 6 |
# File 'lib/upstart_unicorn_launcher.rb', line 4 def command @command end |
#pidfile ⇒ Object
Returns the value of attribute pidfile.
4 5 6 |
# File 'lib/upstart_unicorn_launcher.rb', line 4 def pidfile @pidfile end |
#restarting ⇒ Object
Returns the value of attribute restarting.
4 5 6 |
# File 'lib/upstart_unicorn_launcher.rb', line 4 def restarting @restarting end |
#startup_period ⇒ Object
Returns the value of attribute startup_period.
4 5 6 |
# File 'lib/upstart_unicorn_launcher.rb', line 4 def startup_period @startup_period end |
#tick_period ⇒ Object
Returns the value of attribute tick_period.
4 5 6 |
# File 'lib/upstart_unicorn_launcher.rb', line 4 def tick_period @tick_period end |
#verbose ⇒ Object
Returns the value of attribute verbose.
4 5 6 |
# File 'lib/upstart_unicorn_launcher.rb', line 4 def verbose @verbose end |
Instance Method Details
#start ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/upstart_unicorn_launcher.rb', line 14 def start debug "Starting server" restart_server_on :HUP quit_server_on :QUIT, :INT, :TERM forward_to_server :USR1, :USR2, :WINCH, :TTIN, :TTOU start_server loop do sleep 1 end end |