Class: ChildProcess::Windows::Process

Inherits:
ProcessSpawnProcess show all
Defined in:
lib/childprocess/windows/process.rb

Constant Summary

Constants inherited from AbstractProcess

AbstractProcess::POLL_INTERVAL

Instance Attribute Summary

Attributes inherited from ProcessSpawnProcess

#pid

Attributes inherited from AbstractProcess

#cwd, #detach, #duplex, #environment, #exit_code, #leader

Instance Method Summary collapse

Methods inherited from ProcessSpawnProcess

#exited?, #wait

Methods inherited from AbstractProcess

#alive?, #crashed?, #exited?, #initialize, #pid, #poll_for_exit, #start, #started?, #wait

Constructor Details

This class inherits a constructor from ChildProcess::AbstractProcess

Instance Method Details

#ioObject



6
7
8
# File 'lib/childprocess/windows/process.rb', line 6

def io
  @io ||= Windows::IO.new
end

#stop(timeout = 3) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/childprocess/windows/process.rb', line 10

def stop(timeout = 3)
  assert_started
  send_kill

  begin
    return poll_for_exit(timeout)
  rescue TimeoutError
    # try next
  end

  wait
rescue Errno::ECHILD, Errno::ESRCH
  # handle race condition where process dies between timeout
  # and send_kill
  true
end