Skip to content

Instantly share code, notes, and snippets.

@antirez
Last active August 20, 2021 04:16
Show Gist options
  • Select an option

  • Save antirez/4608754 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

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

srned commented Jan 24, 2013

Copy link
Copy Markdown

@bigmonkeyboy you need to do
psubscribe '*'

@bigmonkeyboy

Copy link
Copy Markdown

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

antirez commented Jan 24, 2013

Copy link
Copy Markdown
Author

Sorry I mispelled psubscribe into subscribe, fixed.

@bigmonkeyboy

Copy link
Copy Markdown

Great.

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

@srned

srned commented Jan 25, 2013

Copy link
Copy Markdown

@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

vonj commented Apr 26, 2013

Copy link
Copy Markdown

Having timer triggers would be just awesome.

@vpArth

vpArth commented Aug 14, 2013

Copy link
Copy Markdown

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

vpArth commented Aug 16, 2013

Copy link
Copy Markdown

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