Sha256: 41a4d8ae01bfde00c18cf7d1cde3e87abf14a977408cbffc4bf67ae41c177fa6
Contents?: true
Size: 700 Bytes
Versions: 50
Compression:
Stored size: 700 Bytes
Contents
module ChildProcess module Unix class Process < AbstractProcess def return_unless_timeout lambda do |timeout| begin return poll_for_exit timeout rescue TimeoutError end end end def stop(timeout = 3, signal=nil) assert_started unless signal.nil? send_signal signal return_unless_timeout.call(timeout) end send_term return_unless_timeout.call(timeout) send_kill wait rescue Errno::ECHILD, Errno::ESRCH # handle race condition where process dies between timeout # and send_kill true end end end end
Version data entries
50 entries across 50 versions & 2 rubygems