Class: RedisRing::MasterRPC::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/redis_ring/master_rpc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_client, host, port) ⇒ Connection

Returns a new instance of Connection.



19
20
21
22
23
# File 'lib/redis_ring/master_rpc.rb', line 19

def initialize(http_client, host, port)
  @http_client = http_client
  @host = host
  @port = port
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



17
18
19
# File 'lib/redis_ring/master_rpc.rb', line 17

def host
  @host
end

#http_clientObject (readonly)

Returns the value of attribute http_client.



17
18
19
# File 'lib/redis_ring/master_rpc.rb', line 17

def http_client
  @http_client
end

#portObject (readonly)

Returns the value of attribute port.



17
18
19
# File 'lib/redis_ring/master_rpc.rb', line 17

def port
  @port
end

Instance Method Details

#node_loaded(node_id) ⇒ Object



25
26
27
# File 'lib/redis_ring/master_rpc.rb', line 25

def node_loaded(node_id)
  http_client.post(host, port, "/master/node_joined/#{node_id}")
end