mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 03:53:09 +00:00
add datacenter
This commit is contained in:
@@ -655,4 +655,12 @@ function skynet.mqlen()
|
||||
return tonumber(c.command "MQLEN")
|
||||
end
|
||||
|
||||
function skynet.globalget(...)
|
||||
return skynet.call("DATACENTER", "lua", "QUERY", ...)
|
||||
end
|
||||
|
||||
function skynet.globalset(...)
|
||||
return skynet.call("DATACENTER", "lua", "UPDATE", ...)
|
||||
end
|
||||
|
||||
return skynet
|
||||
|
||||
@@ -5,6 +5,8 @@ skynet.start(function()
|
||||
skynet.name(".launcher", launcher)
|
||||
|
||||
if skynet.getenv "standalone" then
|
||||
local datacenter = assert(skynet.newservice "datacenter")
|
||||
skynet.name("DATACENTER", datacenter)
|
||||
local smgr = assert(skynet.newservice "service_mgr")
|
||||
skynet.name("SERVICE", smgr)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user