Class: Tlb::BalancerProcess

Inherits:
Object
  • Object
show all
Defined in:
lib/tlb.rb

Direct Known Subclasses

ForkBalancerProcess, JavaBalancerProcess

Defined Under Namespace

Classes: StreamPumper

Instance Method Summary collapse

Constructor Details

#initialize(server_command) ⇒ BalancerProcess

Returns a new instance of BalancerProcess.



147
148
149
150
151
# File 'lib/tlb.rb', line 147

def initialize server_command
  pumper_type, out, err  = start(server_command)
  @out_pumper = pumper_type.new(out, TLB_OUT_FILE)
  @err_pumper = pumper_type.new(err, TLB_ERR_FILE)
end

Instance Method Details

#dieObject



158
159
160
161
# File 'lib/tlb.rb', line 158

def die
  Balancer.terminate
  stop_pumping
end

#stop_pumpingObject



153
154
155
156
# File 'lib/tlb.rb', line 153

def stop_pumping
  @out_pumper.stop_pumping!
  @err_pumper.stop_pumping!
end