Guest User

Untitled

a guest
Jan 21st, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. function blah() {
  2. sub.unsubscribe();
  3. sub.subscribe("a");
  4. sub.subscribe("b");
  5. }
  6.  
  7. var redis = require('redis')
  8.  
  9. const subscribe = redis.createClient({
  10. host: 'localhost',
  11. port: 6379
  12. })
  13. subscribe.psubscribe(`user:chat:*`)
  14.  
  15. subscribe.on('pmessage', function(pattern, channel, message) {
  16. console.log(channel, message, pattern)
  17. // Write Your Awesome Code here.
  18. })
Add Comment
Please, Sign In to add comment