mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
skynet.service: add close (#1526)
Co-authored-by: drew.zxj <drew.zxj@alibaba-inc.com>
This commit is contained in:
@@ -91,6 +91,16 @@ function provider.test(name)
|
||||
end
|
||||
end
|
||||
|
||||
function provider.close(name)
|
||||
local s = svr[name]
|
||||
if not s or s.booting then
|
||||
return skynet.ret(skynet.pack(nil))
|
||||
end
|
||||
|
||||
svr[name] = nil
|
||||
skynet.ret(skynet.pack(s.address))
|
||||
end
|
||||
|
||||
skynet.start(function()
|
||||
skynet.dispatch("lua", function(session, address, cmd, ...)
|
||||
provider[cmd](...)
|
||||
|
||||
Reference in New Issue
Block a user