mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-23 11:33:09 +00:00
Update to lua 5.4 (#1174)
* update to lua 5.4.0-rc1 * remove LUA_ERRGCMM * use age bits for shared * remove unused lbitlib.c * use luaV_fastget * fix #1174 * suspend函数tailcall优化 * 防止没有session导致未调用suspend * luaH_setint check shared (#1184) * set LUA_GCGEN by default * fix #1174 (#1186) checkshared in sweeplist * update to lua 5.4 rc2 * update to lua 5.4 rc4 * move skynet.profile into snlua * Use lua_sethook to interrupt tight loops * remove lua_checksig * critical condition for signals * update to lua 5.4 released * lua 5.4 bugfix * update lua bugfix * fix lua_sharestring (#1224) * update lua * update lua 5.4 * update README * add skynet.select * add test * test error & discard * yield session * request error has no error message * add timeout to skynet.select * bugfix * for lua 5.4 * new version * bugfix * bugfix * use if instead of while * make local * yield in select for * update lua 5.4.1 * change lua version (#1245) Co-authored-by: xiaojin <xiaojin@onemt.com.cn> * update lua version number Co-authored-by: hong <hongling0@gmail.com> Co-authored-by: hong <hongling-0@qq.com> Co-authored-by: 风---自由 <996442717qqcom@gmail.com> Co-authored-by: xiaojin <xiaojin@onemt.com.cn>
This commit is contained in:
@@ -11,6 +11,7 @@ local arg = table.pack(...)
|
||||
assert(arg.n <= 2)
|
||||
local ip = (arg.n == 2 and arg[1] or "127.0.0.1")
|
||||
local port = tonumber(arg[arg.n])
|
||||
local TIMEOUT = 300 -- 3 sec
|
||||
|
||||
local COMMAND = {}
|
||||
local COMMANDX = {}
|
||||
@@ -224,20 +225,32 @@ function COMMAND.list()
|
||||
return skynet.call(".launcher", "lua", "LIST")
|
||||
end
|
||||
|
||||
function COMMAND.stat()
|
||||
return skynet.call(".launcher", "lua", "STAT")
|
||||
local function timeout(ti)
|
||||
if ti then
|
||||
ti = tonumber(ti)
|
||||
if ti <= 0 then
|
||||
ti = nil
|
||||
end
|
||||
else
|
||||
ti = TIMEOUT
|
||||
end
|
||||
return ti
|
||||
end
|
||||
|
||||
function COMMAND.mem()
|
||||
return skynet.call(".launcher", "lua", "MEM")
|
||||
function COMMAND.stat(ti)
|
||||
return skynet.call(".launcher", "lua", "STAT", timeout(ti))
|
||||
end
|
||||
|
||||
function COMMAND.mem(ti)
|
||||
return skynet.call(".launcher", "lua", "MEM", timeout(ti))
|
||||
end
|
||||
|
||||
function COMMAND.kill(address)
|
||||
return skynet.call(".launcher", "lua", "KILL", address)
|
||||
end
|
||||
|
||||
function COMMAND.gc()
|
||||
return skynet.call(".launcher", "lua", "GC")
|
||||
function COMMAND.gc(ti)
|
||||
return skynet.call(".launcher", "lua", "GC", timeout(ti))
|
||||
end
|
||||
|
||||
function COMMAND.exit(address)
|
||||
|
||||
Reference in New Issue
Block a user