Class: EbisuConnection::LoadBalancer

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

Instance Method Summary collapse

Constructor Details

#initialize(replicas) ⇒ LoadBalancer

Returns a new instance of LoadBalancer.



5
6
7
# File 'lib/ebisu_connection/load_balancer.rb', line 5

def initialize(replicas)
  @replicas = replicas
end

Instance Method Details

#replicaObject



9
10
11
# File 'lib/ebisu_connection/load_balancer.rb', line 9

def replica
  @replicas[roulette.sample]
end