CartoDB-SQL-API/batch/job_queue_producer.js
2015-12-21 19:57:10 +01:00

16 lines
365 B
JavaScript

'use strict';
function JobQueueProducer(metadataBackend) {
this.metadataBackend = metadataBackend;
this.db = 5;
}
JobQueueProducer.prototype.enqueue = function (jobId, host, callback) {
var db = this.db;
var queue = 'queue:' + host;
this.metadataBackend.redisCmd(db, 'LPUSH', [queue, jobId], callback);
};
module.exports = JobQueueProducer;