mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +00:00
rewrite SSM and clonefunction
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
local skynet = require "skynet"
|
||||
local harbor = require "skynet.harbor"
|
||||
require "skynet.manager" -- import skynet.launch, ...
|
||||
local memory = require "skynet.memory"
|
||||
|
||||
skynet.start(function()
|
||||
local sharestring = tonumber(skynet.getenv "sharestring" or 4096)
|
||||
memory.ssexpand(sharestring)
|
||||
|
||||
local standalone = skynet.getenv "standalone"
|
||||
|
||||
local launcher = assert(skynet.launch("snlua","launcher"))
|
||||
skynet.name(".launcher", launcher)
|
||||
|
||||
skynet.newservice "garbagecollect"
|
||||
|
||||
local harbor_id = tonumber(skynet.getenv "harbor" or 0)
|
||||
if harbor_id == 0 then
|
||||
assert(standalone == nil)
|
||||
|
||||
@@ -155,7 +155,6 @@ function COMMAND.help()
|
||||
debug = "debug address : debug a lua service",
|
||||
signal = "signal address sig",
|
||||
cmem = "Show C memory info",
|
||||
shrtbl = "Show shared short string table info",
|
||||
ping = "ping address",
|
||||
call = "call address ...",
|
||||
trace = "trace address [proto] [on|off]",
|
||||
@@ -337,11 +336,6 @@ function COMMAND.cmem()
|
||||
return tmp
|
||||
end
|
||||
|
||||
function COMMAND.shrtbl()
|
||||
local n, total, longest, space, slots, variance = memory.ssinfo()
|
||||
return { n = n, total = total, longest = longest, space = space, slots = slots, average = n / slots, variace = variance }
|
||||
end
|
||||
|
||||
function COMMAND.ping(address)
|
||||
address = adjust_address(address)
|
||||
local ti = skynet.now()
|
||||
|
||||
Reference in New Issue
Block a user