Difference between revisions of "Working with Sub-processes in Ruby"

From PeformIQ Wiki
Jump to navigation Jump to search
(Created page with " When working on a POSIX OS you can use fork and exec. fork => Create a subprocess exec => Replace current process with another process You then need to inform that your ...")
(No difference)

Revision as of 11:00, 30 July 2012

When working on a POSIX OS you can use fork and exec.

fork => Create a subprocess
exec => Replace current process with another process

You then need to inform that your main-process is not interested in the created subprocesses via Process.detach.

job1 = fork do
  exec "/path/to/daemon01"
end

Process.detach(job1)

...