mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 11:03:12 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b901c6a38 | ||
|
|
37d64a7028 | ||
|
|
f8bf05513c | ||
|
|
bac9348db9 | ||
|
|
3074dbea0b | ||
|
|
fe4122e579 |
@@ -1,3 +1,9 @@
|
||||
v0.7.1 (2014-9-22)
|
||||
-----------
|
||||
* bugfix: wakeup sleep should return BREAK
|
||||
* bugfix: sharedatad load string
|
||||
* bugfix: dataserver forward error msg
|
||||
|
||||
v0.7.0 (2014-9-8)
|
||||
-----------
|
||||
* Use sproto instead of cjson
|
||||
|
||||
@@ -122,7 +122,7 @@ local function dispatch_wakeup()
|
||||
local session = sleep_session[co]
|
||||
if session then
|
||||
session_id_coroutine[session] = "BREAK"
|
||||
return suspend(co, coroutine.resume(co, true))
|
||||
return suspend(co, coroutine.resume(co, true, "BREAK"))
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -246,7 +246,8 @@ function skynet.sleep(ti)
|
||||
session = tonumber(session)
|
||||
local succ, ret = coroutine_yield("SLEEP", session)
|
||||
sleep_session[coroutine.running()] = nil
|
||||
if ret == true then
|
||||
assert(succ, ret)
|
||||
if ret == "BREAK" then
|
||||
return "BREAK"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -96,7 +96,7 @@ function gateserver.start(handler)
|
||||
|
||||
function MSG.error(fd, msg)
|
||||
if handler.error then
|
||||
handler.error(fd)
|
||||
handler.error(fd, msg)
|
||||
end
|
||||
close_fd(fd)
|
||||
end
|
||||
|
||||
@@ -32,15 +32,18 @@ end
|
||||
|
||||
local CMD = {}
|
||||
|
||||
local env_mt = { __index = _ENV }
|
||||
|
||||
function CMD.new(name, t)
|
||||
local dt = type(t)
|
||||
local value
|
||||
if dt == "table" then
|
||||
value = t
|
||||
elseif dt == "string" then
|
||||
value = {}
|
||||
local f = load(t, "=" .. name, "t", env)
|
||||
value = setmetatable({}, env_mt)
|
||||
local f = load(t, "=" .. name, "t", value)
|
||||
f()
|
||||
setmetatable(value, nil)
|
||||
elseif dt == "nil" then
|
||||
value = {}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user