Sha256: 8859556e364b8cdc01bbfdd0dad581c30e3fde2d62dfd0b000cfe32154bf8b83

Contents?: true

Size: 935 Bytes

Versions: 4

Compression:

Stored size: 935 Bytes

Contents

module Entangler
  module Executor
    module Background
      module Master
        protected

        def start_remote_slave
          require 'open3'
          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("source ~/.rvm/environments/default && #{entangler_cmd}")
          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
            nil
          end
        end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
entangler-1.0.0.beta4 lib/entangler/executor/background/master.rb
entangler-1.0.0.beta3 lib/entangler/executor/background/master.rb
entangler-1.0.0.beta2 lib/entangler/executor/background/master.rb
entangler-1.0.0.beta1 lib/entangler/executor/background/master.rb