skynet.task return session:traceback

This commit is contained in:
Cloud Wu
2014-07-07 19:00:22 +08:00
parent ece89a1b49
commit 4967dc2fce
2 changed files with 5 additions and 5 deletions

View File

@@ -583,11 +583,11 @@ function skynet.mqlen()
return tonumber(c.command "MQLEN") return tonumber(c.command "MQLEN")
end end
function skynet.task(f) function skynet.task(ret)
local t = 0 local t = 0
for _,co in pairs(session_id_coroutine) do for session,co in pairs(session_id_coroutine) do
if f then if ret then
f(debug.traceback(co)) ret[session] = debug.traceback(co)
end end
t = t + 1 t = t + 1
end end

View File

@@ -27,7 +27,7 @@ end
function dbgcmd.TASK() function dbgcmd.TASK()
local task = {} local task = {}
skynet.task(function(info) table.insert(task, info) end) skynet.task(task)
skynet.ret(skynet.pack(task)) skynet.ret(skynet.pack(task))
end end