mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
add option to call process with type and callback only
This commit is contained in:
Vendored
+1
-1
@@ -29,7 +29,7 @@ export declare class Queue extends events.EventEmitter {
|
||||
checkActiveJobTtl(ttlOptions: Object): void;
|
||||
watchStuckJobs(ms: number): void;
|
||||
setting(name: string, fn: Function): Queue;
|
||||
process(type: string, n?: number, fn?: Function): void;
|
||||
process(type: string, n?: number | Function, fn?: Function): void;
|
||||
shutdown(timeout: number, type: string, fn: Function): Queue;
|
||||
types(fn: Function): Queue;
|
||||
state(string: string, fn: Function): Queue;
|
||||
|
||||
@@ -46,7 +46,7 @@ create();
|
||||
|
||||
// process video conversion jobs, 1 at a time.
|
||||
|
||||
jobs.process('video conversion', 1, function(job: kue.Job, done: Function) {
|
||||
var processCb = function(job: kue.Job, done: Function) {
|
||||
var frames: number = job.data.frames;
|
||||
|
||||
function next(i: number) {
|
||||
@@ -61,7 +61,10 @@ jobs.process('video conversion', 1, function(job: kue.Job, done: Function) {
|
||||
}
|
||||
|
||||
next(0);
|
||||
} );
|
||||
}
|
||||
|
||||
jobs.process('video conversion', 1, processCb);
|
||||
jobs.process('video conversion', processCb);
|
||||
|
||||
function convertFrame(i: number, fn: Function) {
|
||||
setTimeout(fn, Math.random() * 50);
|
||||
@@ -102,4 +105,4 @@ jobs.process('email', 10, function(job: kue.Job, done: Function) {
|
||||
|
||||
// start the UI
|
||||
kue.app.listen(3000);
|
||||
console.log('UI started on port 3000');
|
||||
console.log('UI started on port 3000');
|
||||
|
||||
Reference in New Issue
Block a user