Class: ChildProcess::Unix::Process
- Inherits:
-
ProcessSpawnProcess
- Object
- AbstractProcess
- ProcessSpawnProcess
- ChildProcess::Unix::Process
- Defined in:
- lib/childprocess/unix/process.rb
Constant Summary
Constants inherited from AbstractProcess
AbstractProcess::POLL_INTERVAL
Instance Attribute Summary
Attributes inherited from ProcessSpawnProcess
Attributes inherited from AbstractProcess
#cwd, #detach, #duplex, #environment, #exit_code, #leader
Instance Method Summary collapse
Methods inherited from ProcessSpawnProcess
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
#io ⇒ Object
6 7 8 |
# File 'lib/childprocess/unix/process.rb', line 6 def io @io ||= Unix::IO.new end |
#stop(timeout = 3) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/childprocess/unix/process.rb', line 10 def stop(timeout = 3) assert_started send_term begin return poll_for_exit(timeout) rescue TimeoutError # try next end send_kill wait rescue Errno::ECHILD, Errno::ESRCH # handle race condition where process dies between timeout # and send_kill true end |