mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +00:00
snax service support cluster
This commit is contained in:
@@ -54,7 +54,7 @@ end
|
||||
|
||||
skynet.start(function()
|
||||
local init = false
|
||||
skynet.dispatch("snax", function ( session , source , id, ...)
|
||||
local function dispatcher( session , source , id, ...)
|
||||
local method = func[id]
|
||||
|
||||
if method[2] == "system" then
|
||||
@@ -84,5 +84,11 @@ skynet.start(function()
|
||||
assert(init, "Init first")
|
||||
timing(method, ...)
|
||||
end
|
||||
end)
|
||||
end
|
||||
skynet.dispatch("snax", dispatcher)
|
||||
|
||||
-- set lua dispatcher
|
||||
function snax.enablecluster()
|
||||
skynet.dispatch("lua", dispatcher)
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user