Class: Pione::Util::ProcessInfo

Inherits:
StructX
  • Object
show all
Defined in:
lib/pione/util/process-info.rb

Overview

ProcessInfo is a class for watching or manipulating OS processes.

Instance Method Summary collapse

Instance Method Details

#kill(signal = :TERM) ⇒ void

This method returns an undefined value.

Kill the process. This method waits the process to be dead.

Parameters:

  • signal (Symbol) (defaults to: :TERM)

    the signal to send



15
16
17
18
# File 'lib/pione/util/process-info.rb', line 15

def kill(signal = :TERM)
  Process.kill(signal, pid)
  wait
end

#waitObject

Wait until the process is dead.



21
22
23
# File 'lib/pione/util/process-info.rb', line 21

def wait
  thread.join
end