Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
0be51b8f
Commit
0be51b8f
authored
Nov 27, 2017
by
Dvir Volk
Committed by
antirez
Feb 15, 2018
Browse files
Document flags for notifications
parent
3b95c89c
Changes
1
Show whitespace changes
Inline
Side-by-side
src/module.c
View file @
0be51b8f
...
@@ -3696,9 +3696,25 @@ void moduleReleaseGIL(void) {
...
@@ -3696,9 +3696,25 @@ void moduleReleaseGIL(void) {
/* Subscribe to keyspace notifications. This is a low-level version of the
/* Subscribe to keyspace notifications. This is a low-level version of the
* keyspace-notifications API. A module cand register callbacks to be notified
* keyspace-notifications API. A module cand register callbacks to be notified
* when keyspce events occur.
* when keyspce events occur.
*
* Notification events are filtered by their type (string events, set events,
* Notification events are filtered by their type (string events, set events,
* etc), and the subsriber callback receives only events that match a specific
* etc), and the subsriber callback receives only events that match a specific
* mask of event types.
* mask of event types.
*
* When subscribing to notifications with RedisModule_SubscribeToKeyspaceEvents
* the module must provide an event type-mask, denoting the events the subscriber
* is interested in. This can be an ORed mask of any of the following flags:
*
* - REDISMODULE_NOTIFY_GENERIC: Generic commands like DEL, EXPIRE, RENAME
* - REDISMODULE_NOTIFY_STRING: String events
* - REDISMODULE_NOTIFY_LIST: List events
* - REDISMODULE_NOTIFY_SET: Set events
* - REDISMODULE_NOTIFY_HASH: Hash events
* - REDISMODULE_NOTIFY_ZSET: Sorted Set events
* - REDISMODULE_NOTIFY_EXPIRED: Expiration events
* - REDISMODULE_NOTIFY_EVICTED: Eviction events
* - REDISMODULE_NOTIFY_ALL: All events
*
* We do not distinguish between key events and keyspace events, and it is up
* We do not distinguish between key events and keyspace events, and it is up
* to the module to filter the actions taken based on the key.
* to the module to filter the actions taken based on the key.
*
*
...
@@ -3712,7 +3728,7 @@ void moduleReleaseGIL(void) {
...
@@ -3712,7 +3728,7 @@ void moduleReleaseGIL(void) {
* time. The event string is the actual command being executed, and key is the
* time. The event string is the actual command being executed, and key is the
* relevant Redis key.
* relevant Redis key.
*
*
*
A n
otification callback gets executed with a redis context that can not be
*
N
otification callback gets executed with a redis context that can not be
* used to send anything to the client, and has the db number where the event
* used to send anything to the client, and has the db number where the event
* occured as its selected db number.
* occured as its selected db number.
*
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment