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

Version Path
sauce-3.7.2 lib/childprocess/process.rb
sauce-3.7.1 lib/childprocess/process.rb
sauce-3.7.0 lib/childprocess/process.rb
sauce-3.5.11 lib/childprocess/process.rb
sauce-3.5.10 lib/childprocess/process.rb
sauce-3.5.9 lib/childprocess/process.rb
sauce-3.5.8 lib/childprocess/process.rb
sauce-3.5.7 lib/childprocess/process.rb
sauce_ruby-3.5.11 lib/childprocess/process.rb
sauce_ruby-3.5.10 lib/childprocess/process.rb
sauce_ruby-3.5.9 lib/childprocess/process.rb
sauce_ruby-3.5.8 lib/childprocess/process.rb
sauce_ruby-3.5.7 lib/childprocess/process.rb
sauce_ruby-3.5.6 lib/childprocess/process.rb
sauce-3.5.6 lib/childprocess/process.rb
sauce-3.5.5 lib/childprocess/process.rb
sauce-3.5.4 lib/childprocess/process.rb
sauce-3.5.3 lib/childprocess/process.rb
sauce-3.5.2 lib/childprocess/process.rb
sauce-3.5.1 lib/childprocess/process.rb