Sha256: ad9d64b65be4bdd8aff655986c6b0d8c989a66eb3b30b04307d358f05d006227

Contents?: true

Size: 881 Bytes

Versions: 2

Compression:

Stored size: 881 Bytes

Contents

module ChildProcess
  module Windows
    class Process < AbstractProcess

      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

      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
        end

        exited
      end

      private

      def launch_process
        @pid = Lib.create_proc(
          @args.join(' '),
          :inherit => false,
          :detach  => @detach
        )
        @handle = Handle.open(@pid)

        self
      end

    end # Process
  end # Windows
end # ChildProcess

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
childprocess-0.1.0 lib/childprocess/windows/process.rb
childprocess-0.0.9 lib/childprocess/windows/process.rb