2015-12-16 22:57:58 +08:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var redis = require('redis');
|
|
|
|
|
|
|
|
function JobPublisher() {
|
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;
|