cluster servicename is not stable, so don't cache address

This commit is contained in:
Cloud Wu
2014-08-13 19:10:51 +08:00
parent 2cf69a6ef0
commit 845acd3314
3 changed files with 1 additions and 15 deletions

View File

@@ -24,19 +24,6 @@ function cluster.proxy(node, name)
return skynet.call(clusterd, "lua", "proxy", node, name)
end
local namecache = {}
function cluster.ncall(name, ...)
local s = namecache[name]
if not s then
local node , lname = name:match "(.-)(%..+)"
assert(node and lname)
s = cluster.proxy(node, lname)
namecache[name] = assert(s)
end
return skynet.call(s, "lua", ...)
end
skynet.init(function()
clusterd = skynet.uniqueservice("clusterd")
end)