add new api skynet.task()

This commit is contained in:
Cloud Wu
2014-07-07 18:29:27 +08:00
parent f874fdc618
commit ece89a1b49
4 changed files with 29 additions and 0 deletions

View File

@@ -583,6 +583,17 @@ function skynet.mqlen()
return tonumber(c.command "MQLEN")
end
function skynet.task(f)
local t = 0
for _,co in pairs(session_id_coroutine) do
if f then
f(debug.traceback(co))
end
t = t + 1
end
return t
end
-- Inject internal debug framework
local debug = require "skynet.debug"
debug(skynet)