multi cluster sender

This commit is contained in:
Cloud Wu
2019-03-20 17:56:39 +08:00
parent 1d4308f33a
commit 000fa2be3a
4 changed files with 119 additions and 61 deletions

View File

@@ -22,11 +22,12 @@ skynet.forward_type( forward_map ,function()
if n then
address = n
end
local sender = skynet.call(clusterd, "lua", "sender", node)
skynet.dispatch("system", function (session, source, msg, sz)
if session == 0 then
skynet.send(clusterd, "lua", "push", node, address, msg, sz)
else
skynet.ret(skynet.rawcall(clusterd, "lua", skynet.pack("req", node, address, msg, sz)))
skynet.ret(skynet.rawcall(sender, "lua", skynet.pack("req", address, msg, sz)))
end
end)
end)