mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
add snax command to debug console
This commit is contained in:
@@ -7,7 +7,7 @@ skynet.start(function()
|
|||||||
local service = skynet.newservice("service_mgr")
|
local service = skynet.newservice("service_mgr")
|
||||||
skynet.monitor "simplemonitor"
|
skynet.monitor "simplemonitor"
|
||||||
local console = skynet.newservice("console")
|
local console = skynet.newservice("console")
|
||||||
-- skynet.newservice("debug_console",8000)
|
skynet.newservice("debug_console",8000)
|
||||||
skynet.newservice("simpledb")
|
skynet.newservice("simpledb")
|
||||||
local watchdog = skynet.newservice("watchdog")
|
local watchdog = skynet.newservice("watchdog")
|
||||||
skynet.call(watchdog, "lua", "start", {
|
skynet.call(watchdog, "lua", "start", {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
local skynet = require "skynet"
|
local skynet = require "skynet"
|
||||||
local codecache = require "skynet.codecache"
|
local codecache = require "skynet.codecache"
|
||||||
local socket = require "socket"
|
local socket = require "socket"
|
||||||
|
local snax = require "snax"
|
||||||
|
|
||||||
local port = tonumber(...)
|
local port = tonumber(...)
|
||||||
local COMMAND = {}
|
local COMMAND = {}
|
||||||
@@ -109,6 +110,7 @@ function COMMAND.help()
|
|||||||
mem = "mem : show memory status",
|
mem = "mem : show memory status",
|
||||||
gc = "gc : force every lua service do garbage collect",
|
gc = "gc : force every lua service do garbage collect",
|
||||||
start = "lanuch a new lua service",
|
start = "lanuch a new lua service",
|
||||||
|
snax = "lanuch a new snax service",
|
||||||
clearcache = "clear lua code cache",
|
clearcache = "clear lua code cache",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@@ -126,4 +128,12 @@ function COMMAND.start(...)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function COMMAND.snax(...)
|
||||||
|
local s = snax.newservice(...)
|
||||||
|
if s then
|
||||||
|
local addr = s.handle
|
||||||
|
return { [skynet.address(addr)] = ... }
|
||||||
|
else
|
||||||
|
return "Failed"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user