examples/balancing.rb in em-proxy-0.1.8 vs examples/balancing.rb in em-proxy-0.1.9
- old
+ new
@@ -53,9 +53,10 @@
#
def self.select(strategy = :balanced)
@strategy = strategy.to_sym
case @strategy
when :balanced
+ pp [list, list.sort_by { |b| b.load }.first]
backend = list.sort_by { |b| b.load }.first
when :roundrobin
@pool = list.clone if @pool.nil? || @pool.empty?
backend = @pool.shift
when :random