Class: Rackdapter::ProxyBalancer

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

Instance Method Summary collapse

Constructor Details

#initialize(ports) ⇒ ProxyBalancer

Returns a new instance of ProxyBalancer.



54
55
56
57
# File 'lib/rackdapter/spawner.rb', line 54

def initialize(ports)
  @ports = ports
  @seq = 0
end

Instance Method Details

#next_portObject



59
60
61
62
63
64
# File 'lib/rackdapter/spawner.rb', line 59

def next_port
  port = @ports[@seq]
  @seq = @seq + 1
  @seq = 0 if @seq >= @ports.size
  port
end