Merge pull request #4479 from dvirsky/notify

Keyspace notifications API for modules
This commit is contained in:
Salvatore Sanfilippo
2018-02-15 21:36:32 +01:00
committed by GitHub
5 changed files with 304 additions and 38 deletions

View File

@ -100,6 +100,12 @@ 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. */
moduleNotifyKeyspaceEvent(type, event, key, dbid);
/* If notifications for this class of events are off, return ASAP. */
if (!(server.notify_keyspace_events & type)) return;