mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +00:00
use localname .simpledb
This commit is contained in:
@@ -2,8 +2,9 @@ local skynet = require "skynet"
|
|||||||
local cluster = require "cluster"
|
local cluster = require "cluster"
|
||||||
|
|
||||||
skynet.start(function()
|
skynet.start(function()
|
||||||
skynet.newservice("simpledb")
|
local sdb = skynet.newservice("simpledb")
|
||||||
print(skynet.call("SIMPLEDB", "lua", "SET", "a", "foobar"))
|
skynet.name(".simpledb", sdb)
|
||||||
print(skynet.call("SIMPLEDB", "lua", "GET", "a"))
|
print(skynet.call(".simpledb", "lua", "SET", "a", "foobar"))
|
||||||
|
print(skynet.call(".simpledb", "lua", "GET", "a"))
|
||||||
cluster.open "db"
|
cluster.open "db"
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -22,6 +22,5 @@ skynet.start(function()
|
|||||||
error(string.format("Unknown command %s", tostring(cmd)))
|
error(string.format("Unknown command %s", tostring(cmd)))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
skynet.register ".simpledb"
|
|
||||||
skynet.register "SIMPLEDB"
|
skynet.register "SIMPLEDB"
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user