2016-03-10 14:27:00 -08:00
|
|
|
import redis from 'redis';
|
|
|
|
|
|
2016-10-28 12:06:35 -04:00
|
|
|
function createPublisher({redisURL}): any {
|
2016-03-10 14:27:00 -08:00
|
|
|
return redis.createClient(redisURL, { no_ready_check: true });
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-28 12:06:35 -04:00
|
|
|
function createSubscriber({redisURL}): any {
|
2016-03-10 14:27:00 -08:00
|
|
|
return redis.createClient(redisURL, { no_ready_check: true });
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-28 12:06:35 -04:00
|
|
|
const RedisPubSub = {
|
2016-03-10 14:27:00 -08:00
|
|
|
createPublisher,
|
|
|
|
|
createSubscriber
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export {
|
|
|
|
|
RedisPubSub
|
|
|
|
|
}
|