Class: GoodJob::Daemon
- Inherits:
-
Object
- Object
- GoodJob::Daemon
- Defined in:
- lib/good_job/daemon.rb
Overview
Manages daemonization of the current process.
Instance Attribute Summary collapse
-
#pidfile ⇒ Pathname, String
readonly
The path of the generated pidfile.
Instance Method Summary collapse
-
#daemonize ⇒ void
Daemonizes the current process and writes out a pidfile.
-
#initialize(pidfile:) ⇒ Daemon
constructor
A new instance of Daemon.
Constructor Details
#initialize(pidfile:) ⇒ Daemon
Returns a new instance of Daemon.
13 14 15 |
# File 'lib/good_job/daemon.rb', line 13 def initialize(pidfile:) @pidfile = pidfile end |
Instance Attribute Details
#pidfile ⇒ Pathname, String (readonly)
The path of the generated pidfile.
10 11 12 |
# File 'lib/good_job/daemon.rb', line 10 def pidfile @pidfile end |
Instance Method Details
#daemonize ⇒ void
This method returns an undefined value.
Daemonizes the current process and writes out a pidfile.
19 20 21 22 23 24 |
# File 'lib/good_job/daemon.rb', line 19 def daemonize check_pid_dir check_pid ::Process.daemon write_pid end |