回复: 插入 Lua table 到 memcached

21 views
Skip to first unread message

【江飞】

unread,
May 25, 2012, 12:01:15 PM5/25/12
to agentzh, openresty
亦春哥晚上好,谢谢你及时回复。已加入交流群


------------------ 原始邮件 ------------------
发件人: "agentzh";
发送时间: 2012年5月25日(星期五) 晚上11:35
收件人: "【江飞】"<14694...@qq.com>;
抄送: "openresty";
主题: Re: 插入 Lua table 到 memcached

Hello!

2012/5/25 【江飞】 <1469402407@qq.com>:
> 请教下OPENRESTY下,lua通过ngx_memc set信息,可以set lua表不?还是只能设置字符串?
> 我想直接设置lua table ,获取到后也可以直接还原为lua table,不知是否支持,不慎感激,困扰了我两周多了

可以使用 lua-cjson 这样的库自己把 Lua table 序列化为字符串以后再插入 memcached,后续取出时再用 cjson
这样的东西反序列化为 Lua table. ngx_openresty 默认已经包含了 lua-cjson 库。

同时抄送给 openresty 邮件列表:https://groups.google.com/group/openresty 欢迎加入此列表并在那里和我们交流。

Regards,
-agentzh
Reply all
Reply to author
Forward
0 new messages