Class: EbisuConnection::LoadBalancer
- Inherits:
-
Object
- Object
- EbisuConnection::LoadBalancer
- Defined in:
- lib/ebisu_connection/load_balancer.rb
Instance Method Summary collapse
-
#initialize(replicas) ⇒ LoadBalancer
constructor
A new instance of LoadBalancer.
- #replica ⇒ Object
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
#replica ⇒ Object
9 10 11 |
# File 'lib/ebisu_connection/load_balancer.rb', line 9 def replica @replicas[roulette.sample] end |