Skip to content

Instantly share code, notes, and snippets.

@mrkvm
Created October 21, 2012 19:00
Show Gist options
  • Save mrkvm/3928096 to your computer and use it in GitHub Desktop.
Save mrkvm/3928096 to your computer and use it in GitHub Desktop.
A very, very simple Redis PUB/SUB example
# Redis PUB/SUB example:
# client 1:
redis 127.0.0.1:6379> subscribe beartalk
Reading messages... (press Ctrl-C to quit)
1) "subscribe"
2) "beartalk"
3) (integer) 1
# ...wait around for message...
1) "message"
2) "beartalk"
3) "we're having a good time"
# client 2:
redis 127.0.0.1:6379> publish beartalk "we're having a good time"
(integer) 1
Important notes:
- No guaranteed delivery. Make your own guarantees.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment