Sha256: 64928a4f6ee2fda579add45830f66531f8d8a83626173ccde8bf01ec5e80a7d5

Contents?: true

Size: 413 Bytes

Versions: 1

Compression:

Stored size: 413 Bytes

Contents

class WaitPid

  def self.wait_pid(pid, test = false)
    # initial test
    count = 0
    begin
      loop { Process.kill( 0, pid); count += 1; sleep 0.01}
    rescue Errno::ESRCH
      if count == 0
        if test
          return "non existing"
        else
          puts "warning: pid not found #{pid}" if $VERBOSE
        end
      else
        # normal
      end
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wait_pid-0.0.2 lib/wait_pid.rb