Class: Go::Process
- Inherits:
-
Object
- Object
- Go::Process
- Defined in:
- lib/go/process.rb
Instance Method Summary collapse
-
#initialize(*pipes, &block) ⇒ Process
constructor
A new instance of Process.
- #kill ⇒ Object
- #pid ⇒ Object
- #wait ⇒ Object
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
#kill ⇒ Object
16 17 18 |
# File 'lib/go/process.rb', line 16 def kill ::Process.kill 9, pid end |
#pid ⇒ Object
12 13 14 |
# File 'lib/go/process.rb', line 12 def pid @pid end |
#wait ⇒ Object
8 9 10 |
# File 'lib/go/process.rb', line 8 def wait ::Process.wait pid end |