forked from OptimalBits/bull
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha.js
More file actions
32 lines (22 loc) · 669 Bytes
/
Copy patha.js
File metadata and controls
32 lines (22 loc) · 669 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"use strict";
var Queue = require('./');
var videoQueue = Queue('video transcoding', 6379, '127.0.0.1');
videoQueue.process(function(job, done){
console.log('video job %d started.', job.jobId);
done();
});
videoQueue.on('completed', function(job) {
console.log('video job %d completed.', job.jobId);
});
videoQueue.add({video: 'http://example.com/video1.mov'});
videoQueue.add({video: 'http://example.com/video1.mov'});
videoQueue.add({video: 'http://example.com/video1.mov'});
/**
*
* Tasks
*
*/
queue.task('video', opts, function(input, next){
output = do_something_with_input(input);
next('postprocess', output);
});