mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 03:53:09 +00:00
service client and a simple DB example
This commit is contained in:
@@ -16,7 +16,12 @@ end
|
||||
skynet.dispatch(function(message, from, session)
|
||||
print("simpledb",message, from, session)
|
||||
local cmd, key , value = string.match(message, "(%w+) (%w+) ?(.*)")
|
||||
command[cmd](key,value)
|
||||
local f = command[cmd]
|
||||
if f then
|
||||
f(key,value)
|
||||
else
|
||||
skynet.ret("Invalid command : "..message)
|
||||
end
|
||||
end)
|
||||
|
||||
skynet.register "SIMPLEDB"
|
||||
|
||||
Reference in New Issue
Block a user