Class: ChildProcess::Windows::Process
- Inherits:
-
AbstractProcess
- Object
- AbstractProcess
- ChildProcess::Windows::Process
- Defined in:
- lib/childprocess/windows/process.rb
Constant Summary
Constants inherited from AbstractProcess
AbstractProcess::POLL_INTERVAL
Instance Attribute Summary collapse
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
Attributes inherited from AbstractProcess
#detach, #duplex, #environment, #exit_code
Instance Method Summary collapse
Methods inherited from AbstractProcess
#alive?, #crashed?, #initialize, #poll_for_exit, #start
Constructor Details
This class inherits a constructor from ChildProcess::AbstractProcess
Instance Attribute Details
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
5 6 7 |
# File 'lib/childprocess/windows/process.rb', line 5 def pid @pid end |
Instance Method Details
#exited? ⇒ Boolean
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/childprocess/windows/process.rb', line 31 def exited? return true if @exit_code assert_started code = @handle.exit_code exited = code != PROCESS_STILL_ACTIVE log(:exited? => exited, :code => code) if exited @exit_code = code @handle.close end exited end |
#io ⇒ Object
7 8 9 |
# File 'lib/childprocess/windows/process.rb', line 7 def io @io ||= Windows::IO.new end |
#stop(timeout = 3) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/childprocess/windows/process.rb', line 11 def stop(timeout = 3) assert_started # just kill right away on windows. log "sending KILL" @handle.send(WIN_SIGKILL) poll_for_exit(timeout) ensure @handle.close end |
#wait ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/childprocess/windows/process.rb', line 23 def wait @handle.wait @exit_code = @handle.exit_code @handle.close @exit_code end |