use localname .simpledb

This commit is contained in:
Cloud Wu
2014-08-13 18:05:11 +08:00
parent 978e010e67
commit 2cf69a6ef0
2 changed files with 4 additions and 4 deletions

View File

@@ -2,8 +2,9 @@ local skynet = require "skynet"
local cluster = require "cluster"
skynet.start(function()
skynet.newservice("simpledb")
print(skynet.call("SIMPLEDB", "lua", "SET", "a", "foobar"))
print(skynet.call("SIMPLEDB", "lua", "GET", "a"))
local sdb = skynet.newservice("simpledb")
skynet.name(".simpledb", sdb)
print(skynet.call(".simpledb", "lua", "SET", "a", "foobar"))
print(skynet.call(".simpledb", "lua", "GET", "a"))
cluster.open "db"
end)

View File

@@ -22,6 +22,5 @@ skynet.start(function()
error(string.format("Unknown command %s", tostring(cmd)))
end
end)
skynet.register ".simpledb"
skynet.register "SIMPLEDB"
end)