Class: Go::Process

Inherits:
Object
  • Object
show all
Defined in:
lib/go/process.rb

Instance Method Summary collapse

Constructor Details

#initialize(*pipes, &block) ⇒ Process

Returns a new instance of Process.



4
5
6
# File 'lib/go/process.rb', line 4

def initialize *pipes, &block
  @pid = fork { block.call *pipes }
end

Instance Method Details

#killObject



16
17
18
# File 'lib/go/process.rb', line 16

def kill
  ::Process.kill 9, pid
end

#pidObject



12
13
14
# File 'lib/go/process.rb', line 12

def pid
  @pid
end

#waitObject



8
9
10
# File 'lib/go/process.rb', line 8

def wait
  ::Process.wait pid
end