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.



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

def initialize
end

Instance Method Details

#joinObject



34
35
36
37
38
# File 'lib/sub/root.rb', line 34

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

#launchObject



27
28
29
30
31
32
# File 'lib/sub/root.rb', line 27

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