Class: Tlb::ForkBalancerProcess

Inherits:
BalancerProcess show all
Defined in:
lib/tlb.rb

Instance Method Summary collapse

Methods inherited from BalancerProcess

#initialize, #stop_pumping

Constructor Details

This class inherits a constructor from Tlb::BalancerProcess

Instance Method Details

#dieObject



181
182
183
184
185
# File 'lib/tlb.rb', line 181

def die
  super
  @pid = nil
  Process.wait
end

#start(server_command) ⇒ Object



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/tlb.rb', line 165

def start server_command
  @pid, input, out, err = Open4.popen4(server_command)
  unless (out)
    raise "out was nil"
  end
  return Class.new(StreamPumper) do
    def data_available?
      not @stream.eof?
    end

    def read
      @stream.read
    end
  end, out, err
end