2015-12-16 22:57:58 +08:00
|
|
|
'use strict';
|
|
|
|
|
2016-01-23 02:31:25 +08:00
|
|
|
function JobPublisher(redis) {
|
2015-12-29 22:46:04 +08:00
|
|
|
this.channel = 'batch:hosts';
|
2015-12-16 22:57:58 +08:00
|
|
|
this.client = redis.createClient(global.settings.redis_port, global.settings.redis_host);
|
|
|
|
}
|
|
|
|
|
|
|
|
JobPublisher.prototype.publish = function (host) {
|
|
|
|
this.client.publish(this.channel, host);
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = JobPublisher;
|