Method: Unicorn::Worker#initialize

Defined in:
lib/unicorn/worker.rb

#initialize(nr, pipe = nil) ⇒ Worker

Returns a new instance of Worker.



20
21
22
23
24
25
26
27
28
# File 'lib/unicorn/worker.rb', line 20

def initialize(nr, pipe=nil)
  drop_index = nr / PER_DROP
  @raindrop = DROPS[drop_index] ||= Raindrops.new(PER_DROP)
  @offset = nr % PER_DROP
  @raindrop[@offset] = 0
  @nr = nr
  @switched = false
  @to_io, @master = pipe || Unicorn.pipe
end