diff --git a/examples/cluster1.lua b/examples/cluster1.lua index 551b0f38..6bb3b68d 100644 --- a/examples/cluster1.lua +++ b/examples/cluster1.lua @@ -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) diff --git a/examples/simpledb.lua b/examples/simpledb.lua index e70d2f86..3a7649e6 100644 --- a/examples/simpledb.lua +++ b/examples/simpledb.lua @@ -22,6 +22,5 @@ skynet.start(function() error(string.format("Unknown command %s", tostring(cmd))) end end) - skynet.register ".simpledb" skynet.register "SIMPLEDB" end)