summaryrefslogtreecommitdiff
path: root/src/notify.c
diff options
context:
space:
mode:
authorDvir Volk <dvirsky@gmail.com>2017-11-27 16:29:55 +0200
committerDvir Volk <dvirsky@gmail.com>2018-02-14 21:38:58 +0200
commit2136035e47c5c50aec07270e0c87a9e5cd5e243d (patch)
treef577f2d9e24ec7e0ad379a3f3993a71bae784338 /src/notify.c
parent4f2d279dd704ebf0e9ebab85bc74269b523eda8a (diff)
downloadredis-2136035e47c5c50aec07270e0c87a9e5cd5e243d.tar.gz
finished implementation of notifications. Tests unfinished
Diffstat (limited to 'src/notify.c')
-rw-r--r--src/notify.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/notify.c b/src/notify.c
index 9bbeb1423..e77f67916 100644
--- a/src/notify.c
+++ b/src/notify.c
@@ -87,6 +87,8 @@ sds keyspaceEventsFlagsToString(int flags) {
return res;
}
+
+
/* The API provided to the rest of the Redis core is a simple function:
*
* notifyKeyspaceEvent(char *event, robj *key, int dbid);
@@ -100,6 +102,13 @@ void notifyKeyspaceEvent(int type, char *event, robj *key, int dbid) {
int len = -1;
char buf[24];
+ /* If any modules are interested in events, notify the module system now.
+ * This bypasses the notifications configuration, but the module engine
+ * will only call event subscribers if the event type matches the types
+ * they are interested in. */
+ if (server.notify_keyspace_events & NOTIFY_MODULE)
+ moduleNotifyKeyspaceEvent(type, event, key, dbid);
+
/* If notifications for this class of events are off, return ASAP. */
if (!(server.notify_keyspace_events & type)) return;