Class: Root::Processes

Inherits:
Array
  • Object
show all
Defined in:
lib/sub/root.rb

Instance Method Summary collapse

Methods inherited from Array

#has?, #subtract

Constructor Details

#initializeProcesses

Returns a new instance of Processes.



13
14
# File 'lib/sub/root.rb', line 13

def initialize
end

Instance Method Details

#joinObject



23
24
25
26
27
# File 'lib/sub/root.rb', line 23

def join
  self.each do |pid|
    Process.waitpid(pid, 0)
  end
end

#launchObject



16
17
18
19
20
21
# File 'lib/sub/root.rb', line 16

def launch
  pid = fork do
    yield
  end
  self << pid
end