mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
skynet.exit will call every unresponse handle
This commit is contained in:
@@ -44,6 +44,7 @@ local session_id_coroutine = {}
|
|||||||
local session_coroutine_id = {}
|
local session_coroutine_id = {}
|
||||||
local session_coroutine_address = {}
|
local session_coroutine_address = {}
|
||||||
local session_response = {}
|
local session_response = {}
|
||||||
|
local unresponse = {}
|
||||||
|
|
||||||
local wakeup_session = {}
|
local wakeup_session = {}
|
||||||
local sleep_session = {}
|
local sleep_session = {}
|
||||||
@@ -224,11 +225,13 @@ function suspend(co, result, command, param, size)
|
|||||||
ret = false
|
ret = false
|
||||||
end
|
end
|
||||||
release_watching(co_address)
|
release_watching(co_address)
|
||||||
|
unresponse[response] = nil
|
||||||
f = nil
|
f = nil
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
watching_service[co_address] = watching_service[co_address] + 1
|
watching_service[co_address] = watching_service[co_address] + 1
|
||||||
session_response[co] = response
|
session_response[co] = response
|
||||||
|
unresponse[response] = true
|
||||||
return suspend(co, coroutine.resume(co, response))
|
return suspend(co, coroutine.resume(co, response))
|
||||||
elseif command == "EXIT" then
|
elseif command == "EXIT" then
|
||||||
-- coroutine exit
|
-- coroutine exit
|
||||||
@@ -361,6 +364,9 @@ function skynet.exit()
|
|||||||
c.redirect(address, 0, skynet.PTYPE_ERROR, session, "")
|
c.redirect(address, 0, skynet.PTYPE_ERROR, session, "")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
for resp in pairs(unresponse) do
|
||||||
|
resp(false)
|
||||||
|
end
|
||||||
-- report the sources I call but haven't return
|
-- report the sources I call but haven't return
|
||||||
local tmp = {}
|
local tmp = {}
|
||||||
for session, address in pairs(watching_session) do
|
for session, address in pairs(watching_session) do
|
||||||
|
|||||||
Reference in New Issue
Block a user