Module: Process

Defined in:
lib/hot_potato/utils.rb

Class Method Summary collapse

Class Method Details

.alive?(pid) ⇒ Boolean

Return true if the process is still running, false otherwise.

Returns:

  • (Boolean)


4
5
6
7
8
9
10
11
# File 'lib/hot_potato/utils.rb', line 4

def self.alive?(pid)
  begin
    Process.getpgid(pid)
    return true
  rescue Errno::ESRCH
    return false
  end
end