Groups
Groups
Sign in
Groups
Groups
skynet-users
Conversations
About
Send feedback
Help
skynet的redis接口如何接收subscribe后续传来的订阅消息?
264 views
Skip to first unread message
simon...@gmail.com
unread,
Dec 4, 2014, 2:37:54 AM
12/4/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to skynet...@googlegroups.com, simo...@163.com
因为想在skynet服务中实现对redis数据库过期删除的触发事件,因此使用了以下的代码
local
res
=
db
:
subscribe
(
"__keyevent@*__:expired"
)
像python的话会有.listen(),然后抛出得到的消息,不知道skynet中是怎么实现的?res中只有订阅成功的提示消息。
问题水平很菜,但试了很久也没能搞定,希望可以拨冗指点一二:)
云风
unread,
Dec 7, 2014, 10:17:19 PM
12/7/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to skynet...@googlegroups.com, simo...@163.com
https://github.com/cloudwu/skynet/blob/master/test/testredis.lua#L10-L17
这里有例子
在 2014年12月4日星期四UTC+8下午3时37分54秒,
simon...@gmail.com
写道:
Reply all
Reply to author
Forward
0 new messages