mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
skynet.task return session:traceback
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user