Class: Bundler::ParallelWorkers::UnixWorker

Inherits:
Worker
  • Object
show all
Defined in:
lib/bundler/parallel_workers/unix_worker.rb

Overview

UnixWorker is used only on platforms where fork is available. The way this code works is, it forks a preconfigured number of workers and then It starts preconfigured number of threads that write to the connected pipe.

Defined Under Namespace

Classes: JobHandler

Constant Summary

Constants inherited from Worker

Worker::POISON

Instance Method Summary collapse

Methods inherited from Worker

#deq, #enq, #stop

Constructor Details

#initialize(size, job) ⇒ UnixWorker

Returns a new instance of UnixWorker.



17
18
19
20
21
# File 'lib/bundler/parallel_workers/unix_worker.rb', line 17

def initialize(size, job)
  # Close the persistent connections for the main thread before forking
  Net::HTTP::Persistent.new('bundler', :ENV).shutdown
  super
end