Class: Rackdapter::ProxyBalancer
- Inherits:
-
Object
- Object
- Rackdapter::ProxyBalancer
- Defined in:
- lib/rackdapter/spawner.rb
Instance Method Summary collapse
-
#initialize(ports) ⇒ ProxyBalancer
constructor
A new instance of ProxyBalancer.
- #next_port ⇒ Object
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_port ⇒ Object
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 |