add snax.self and snax.exit

This commit is contained in:
Cloud Wu
2014-11-14 15:11:05 +08:00
parent 8e4a175155
commit b9e06dc065
3 changed files with 14 additions and 1 deletions

View File

@@ -132,6 +132,14 @@ function snax.kill(obj, ...)
skynet_call(obj.handle, "snax", t.system.exit, ...)
end
function snax.self()
return snax.bind(skynet.self(), SERVICE_NAME)
end
function snax.exit(...)
snax.kill(snax.self(), ...)
end
local function test_result(ok, ...)
if ok then
return ...