cluster rpc support large package

This commit is contained in:
Cloud Wu
2015-08-04 16:47:55 +08:00
parent 704b016f2c
commit b5244b96aa
5 changed files with 418 additions and 67 deletions

View File

@@ -3,7 +3,12 @@ local cluster = require "cluster"
skynet.start(function()
local proxy = cluster.proxy("db", ".simpledb")
print(skynet.call(proxy, "lua", "GET", "a"))
local largekey = string.rep("X", 128*1024)
local largevalue = string.rep("R", 100 * 1024)
print(skynet.call(proxy, "lua", "SET", largekey, largevalue))
local v = skynet.call(proxy, "lua", "GET", largekey)
assert(largevalue == v)
print(cluster.call("db", ".simpledb", "GET", "a"))
print(cluster.call("db2", ".simpledb", "GET", "b"))