summaryrefslogtreecommitdiff
path: root/src/t_list.c
diff options
context:
space:
mode:
authorGuy Benoish <guy.benoish@redislabs.com>2018-03-22 17:22:26 +0700
committerGuy Benoish <guy.benoish@redislabs.com>2018-03-22 17:22:26 +0700
commitfa00e20b165c5e55f437ceddde9f492cafd38143 (patch)
tree67bce0d4b6420751f6b3234528e248536ae336b3 /src/t_list.c
parent3a5bf75ede389981f1e63b305dad431c8ccc91ea (diff)
downloadredis-fa00e20b165c5e55f437ceddde9f492cafd38143.tar.gz
Make blocking list commands send keyspace notifications
Diffstat (limited to 'src/t_list.c')
-rw-r--r--src/t_list.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/t_list.c b/src/t_list.c
index c7e6aac00..1414ff31a 100644
--- a/src/t_list.c
+++ b/src/t_list.c
@@ -639,6 +639,10 @@ int serveClientBlockedOnList(client *receiver, robj *key, robj *dstkey, redisDb
addReplyMultiBulkLen(receiver,2);
addReplyBulk(receiver,key);
addReplyBulk(receiver,value);
+
+ /* Notify event. */
+ char *event = (where == LIST_HEAD) ? "lpop" : "rpop";
+ notifyKeyspaceEvent(NOTIFY_LIST,event,key,receiver->db->id);
} else {
/* BRPOPLPUSH */
robj *dstobj =
@@ -663,6 +667,9 @@ int serveClientBlockedOnList(client *receiver, robj *key, robj *dstkey, redisDb
db->id,argv,3,
PROPAGATE_AOF|
PROPAGATE_REPL);
+
+ /* Notify event ("lpush" was notified by rpoplpushHandlePush). */
+ notifyKeyspaceEvent(NOTIFY_LIST,"rpop",key,receiver->db->id);
} else {
/* BRPOPLPUSH failed because of wrong
* destination type. */