Skip to content

peteruithoven/redis-pubsubber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redis-pubsubber

Redis pub/sub channel wrapper.

  • Messages are serialized to JSON.
  • Allows multiple argumens
  • Includes a callback system.
  • Multiple channels per pub/sub client.

Example

// create pub/sub instance (creates redis pub and sub clients
var redisPubSub = require('redis-pubsubber')('mycloud',6379,'localhost');
// create a channel 
var redisChannel = redisPubSub.createChannel("mychannel");
// listen for messages on channel
redisChannel.on("message", function (firstParam,data,callback) {
  // perform some action, respond by calling callback
});
// publish message to channel 
redisChannel.publish("firstdata",{"some":"data"},function(responseData) {
  // do something with the response
});

About

Redis pub/sub channel wrapper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published