Skip to content

Instantly share code, notes, and snippets.

@antirez
Last active August 20, 2021 04:16
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antirez/4608754 to your computer and use it in GitHub Desktop.
Save antirez/4608754 to your computer and use it in GitHub Desktop.
Compile the Redis "notifications" branch on Github.
Start Redis with ./redis-server --notify-keyspace-events yes
Subscribe to all the events with:
redis-cli psubscribe '*'
In another terminal window, play with redis-cli: set, del, expire, ... Only a few already work.
@bigmonkeyboy
Copy link

Hi, just tried 32bit on Ubuntu 12.04.
Ran as - ./redis-server --notify-keyspace-events yes
Client 1 as - redis-cli subscribe '*'
Client 2 as - redis-cli set foo bar

no output on client 1... :-(

@srned
Copy link

srned commented Jan 24, 2013

@bigmonkeyboy you need to do
psubscribe '*'

@bigmonkeyboy
Copy link

great - works fine... however if I add to redis.conf (for autostart)
Starting redis-server:
*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 543

'notify-keyspace-events yes'
Bad directive or wrong number of arguments

@antirez
Copy link
Author

antirez commented Jan 24, 2013

Sorry I mispelled psubscribe into subscribe, fixed.

@bigmonkeyboy
Copy link

Great.

sorry - still not sure how to fix it to auto-start in notification mode :-)

@srned
Copy link

srned commented Jan 25, 2013

@bigmonkeyboy it works just fine for me. Can you try with the default redis.conf ? You need to switch the configuration which is disabled by default.

@vonj
Copy link

vonj commented Apr 26, 2013

Having timer triggers would be just awesome.

@vpArth
Copy link

vpArth commented Aug 14, 2013

Help me please

arth@l300:~/redisworks/redis-2.6.14/src$ ./redis-server --version
Redis server v=2.6.14 sha=00000000:0 malloc=jemalloc-3.2.0 bits=64
arth@l300:~/redisworks/redis-2.6.14/src$ ./redis-server --notify-keyspace-events yes

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 2
>>> 'notify-keyspace-events "yes"'
Bad directive or wrong number of arguments

Where I wrong?
How should I install redis to use this feature?

@vpArth
Copy link

vpArth commented Aug 16, 2013

Solved, update for origin/2.8(not 'notifications') branch and compile from it.
Works excellent! This is killer feature, thanks for implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment