我希望获得一个带有特定键和特定事件的键空间通知。就像我想要一个关键名称'foo'与事件'set'一起操作时的通知。有什么方法可以将两者结合起来
psubscribe '__keyevent@0__,__keyspace@0__:set foo'.
答案 0 :(得分:1)
遗憾的是,您不必订阅事件和密钥空间通知,并过滤订阅者中的邮件。
答案 1 :(得分:0)
K Keyspace events, published with __keyspace@<db>__ prefix.
E Keyevent events, published with __keyevent@<db>__ prefix.
g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ...
$ String commands
l List commands
s Set commands
h Hash commands
z Sorted set commands
x Expired events (events generated every time a key expires)
e Evicted events (events generated when a key is evicted for maxmemory)
A Alias for g$lshzxe, so that the "AKE" string means all the events.
字符串中应至少包含K
或E
,否则无论字符串的其余部分如何,都不会传递任何事件。
例如,为列表启用密钥空间事件,配置参数必须设置为Kl,依此类推。
字符串KEA
可用于启用每个可能的事件。