Sha256: 737392ece6023bb512a302566161b5f3f77a20f9b4989de8708939f929a8d4c7

Contents?: true

Size: 1002 Bytes

Versions: 8

Compression:

Stored size: 1002 Bytes

Contents

# frozen_string_literal: true

require 'open3'

module Entangler
  module Executor
    module Background
      module Master
        protected

        def start_remote_slave
          logger.info('Starting - Entangler on remote')
          ignore_opts = @opts[:ignore].map { |regexp| "-i '#{regexp.inspect}'" }.join(' ')
          entangler_cmd = "entangler slave #{@opts[:remote_base_dir]} #{ignore_opts}"
          ssh_cmd = generate_ssh_command(entangler_cmd, source_rvm: true)
          full_cmd = @opts[:remote_mode] ? ssh_cmd : entangler_cmd

          @remote_writer, @remote_reader, remote_err, @remote_thread = Open3.popen3(full_cmd)
          remote_err.close
        end

        def wait_for_threads
          super
          begin
            Process.wait @remote_thread[:pid]
          rescue StandardError
            nil
          end
        end

        def kill_off_threads
          Process.kill('INT', @remote_thread[:pid])
          super
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
entangler-1.5.1 lib/entangler/executor/background/master.rb
entangler-1.5.0 lib/entangler/executor/background/master.rb
entangler-1.4.1 lib/entangler/executor/background/master.rb
entangler-1.4.0 lib/entangler/executor/background/master.rb
entangler-1.3.3 lib/entangler/executor/background/master.rb
entangler-1.3.2 lib/entangler/executor/background/master.rb
entangler-1.3.1 lib/entangler/executor/background/master.rb
entangler-1.3.0 lib/entangler/executor/background/master.rb