mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
add trace into simpledb
This commit is contained in:
@@ -13,8 +13,16 @@ function command.SET(key, value)
|
||||
skynet.ret(last)
|
||||
end
|
||||
|
||||
local trace_cache = {}
|
||||
|
||||
skynet.trace_callback(function(handle, ti)
|
||||
print("TRACE",trace_cache[handle],ti)
|
||||
trace_cache[handle] = nil
|
||||
end)
|
||||
|
||||
skynet.start(function()
|
||||
skynet.dispatch("text", function(session, address, message)
|
||||
trace_cache[skynet.trace()] = message
|
||||
print("simpledb",message, skynet.address(address), session)
|
||||
local cmd, key , value = string.match(message, "(%w+) (%w+) ?(.*)")
|
||||
local f = command[cmd]
|
||||
|
||||
Reference in New Issue
Block a user