Class: LoadBalancedRestClient

Inherits:
Object
  • Object
show all
Includes:
RestClientProxy
Defined in:
lib/server.rb,
lib/cluster.rb,
lib/version.rb,
lib/load_balancer.rb,
lib/rest_client_proxy.rb,
lib/load_balanced_rest_client.rb,
lib/algorithms/linear_downtime.rb,
lib/algorithms/exponential_downtime.rb

Defined Under Namespace

Modules: Algorithms, RestClientProxy Classes: Cluster, LoadBalancer, RestClientProxyCall, Server

Constant Summary collapse

VERSION =
"1.0.2"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RestClientProxy

#[], #method_missing

Constructor Details

#initialize(servers, opts = {}) ⇒ LoadBalancedRestClient

Returns a new instance of LoadBalancedRestClient.



14
15
16
17
# File 'lib/load_balanced_rest_client.rb', line 14

def initialize(servers, opts={})
  @cluster       = Cluster.new(servers, opts)
  @load_balancer = LoadBalancer.new(@cluster, opts)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class LoadBalancedRestClient::RestClientProxy

Instance Attribute Details

#clusterObject

Returns the value of attribute cluster.



11
12
13
# File 'lib/load_balanced_rest_client.rb', line 11

def cluster
  @cluster
end

#load_balancerObject

Returns the value of attribute load_balancer.



11
12
13
# File 'lib/load_balanced_rest_client.rb', line 11

def load_balancer
  @load_balancer
end