I have a Redis client like so:
var redis = require("redis");
var client = redis.createClient();
client.config("SET","notify-keyspace-events", "KEA");
with the 3rd line of code, it is now configured to listen to sets and deletes of Redis keys. So this client acts as a subscriber. However, the problem is that I want this Redis client to also be able to re-publish information it receives from Redis itself, and the same Redis client can't act as both subscriber and publisher. So it seems I have two choices:
- use a second Redis client in the same file, to act as a publisher
- use Socket.io with only one Redis client instead of two
Is this correct? Which one is better in this case?