@types/bull
Advanced tools
Comparing version 3.4.2 to 3.4.3
@@ -15,2 +15,3 @@ // Type definitions for bull 3.4 | ||
// Kjell-Morten Bratsberg Thorsen <https://github.com/kjellmorten> | ||
// Christian D. <https://github.com/pc-jedi> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -346,26 +347,14 @@ // TypeScript Version: 2.8 | ||
* | ||
* If the callback signature contains the second optional done argument, | ||
* the callback will be passed a done callback to be called after the job has been completed. | ||
* The done callback can be called with an Error instance, to signal that the job did not complete successfully, | ||
* or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. | ||
* Errors will be passed as a second argument to the "failed" event; | ||
* results, as a second argument to the "completed" event. | ||
*/ | ||
process(callback: (job: Job<T>, done: DoneCallback) => void): void; | ||
/** | ||
* Defines a processing function for the jobs placed into a given Queue. | ||
* or with a result as second argument (e.g.: done(null, result);) when the job is successful. | ||
* Errors will be passed as a second argument to the "failed" event; results, as a second argument to the "completed" event. | ||
* | ||
* The callback is called everytime a job is placed in the queue. | ||
* It is passed an instance of the job as first argument. | ||
* The callback can also be defined as the string path to a module | ||
* exporting the callback function. Using a path has several advantages: | ||
* - The process is sandboxed so if it crashes it does not affect the worker. | ||
* - You can run blocking code without affecting the queue (jobs will not stall). | ||
* - Much better utilization of multi-core CPUs. | ||
* - Less connections to redis. | ||
* | ||
* A promise must be returned to signal job completion. | ||
* If, however, the callback signature does not contain the done argument, | ||
* a promise must be returned to signal job completion. | ||
* If the promise is rejected, the error will be passed as a second argument to the "failed" event. | ||
* If it is resolved, its value will be the "completed" event's second argument. | ||
*/ | ||
process(callback: ((job: Job<T>) => void) | string): Promise<any>; | ||
process(callback: ((job: Job<T>, done: DoneCallback) => void) | ((job: Job<T>) => Promise<any>) | string): void; | ||
@@ -377,16 +366,17 @@ /** | ||
* It is passed an instance of the job as first argument. | ||
* The callback can also be defined as the string path to a module | ||
* exporting the callback function. Using a path has several advantages: | ||
* - The process is sandboxed so if it crashes it does not affect the worker. | ||
* - You can run blocking code without affecting the queue (jobs will not stall). | ||
* - Much better utilization of multi-core CPUs. | ||
* - Less connections to redis. | ||
* | ||
* A promise must be returned to signal job completion. | ||
* If the callback signature contains the second optional done argument, | ||
* the callback will be passed a done callback to be called after the job has been completed. | ||
* The done callback can be called with an Error instance, to signal that the job did not complete successfully, | ||
* or with a result as second argument (e.g.: done(null, result);) when the job is successful. | ||
* Errors will be passed as a second argument to the "failed" event; results, as a second argument to the "completed" event. | ||
* | ||
* If, however, the callback signature does not contain the done argument, | ||
* a promise must be returned to signal job completion. | ||
* If the promise is rejected, the error will be passed as a second argument to the "failed" event. | ||
* If it is resolved, its value will be the "completed" event's second argument. | ||
* | ||
* @param concurrency Bull will then call you handler in parallel respecting this max number. | ||
* @param concurrency Bull will then call your handler in parallel respecting this maximum value. | ||
*/ | ||
process(concurrency: number, callback: ((job: Job<T>) => void) | string): Promise<any>; | ||
process(concurrency: number, callback: ((job: Job<T>, done: DoneCallback) => void) | ((job: Job<T>) => Promise<any>) | string): void; | ||
@@ -399,24 +389,10 @@ /** | ||
* | ||
* If the callback signature contains the second optional done argument, | ||
* the callback will be passed a done callback to be called after the job has been completed. | ||
* The done callback can be called with an Error instance, to signal that the job did not complete successfully, | ||
* or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. | ||
* Errors will be passed as a second argument to the "failed" event; | ||
* results, as a second argument to the "completed" event. | ||
* or with a result as second argument (e.g.: done(null, result);) when the job is successful. | ||
* Errors will be passed as a second argument to the "failed" event; results, as a second argument to the "completed" event. | ||
* | ||
* @param concurrency Bull will then call you handler in parallel respecting this max number. | ||
*/ | ||
process(concurrency: number, callback: (job: Job<T>, done: DoneCallback) => void): void; | ||
/** | ||
* Defines a named processing function for the jobs placed into a given Queue. | ||
* | ||
* The callback is called everytime a job is placed in the queue. | ||
* It is passed an instance of the job as first argument. | ||
* The callback can also be defined as the string path to a module | ||
* exporting the callback function. Using a path has several advantages: | ||
* - The process is sandboxed so if it crashes it does not affect the worker. | ||
* - You can run blocking code without affecting the queue (jobs will not stall). | ||
* - Much better utilization of multi-core CPUs. | ||
* - Less connections to redis. | ||
* | ||
* A promise must be returned to signal job completion. | ||
* If, however, the callback signature does not contain the done argument, | ||
* a promise must be returned to signal job completion. | ||
* If the promise is rejected, the error will be passed as a second argument to the "failed" event. | ||
@@ -428,3 +404,3 @@ * If it is resolved, its value will be the "completed" event's second argument. | ||
// tslint:disable-next-line:unified-signatures | ||
process(name: string, callback: ((job: Job<T>) => void) | string): Promise<any>; | ||
process(name: string, callback: ((job: Job<T>, done: DoneCallback) => void) | ((job: Job<T>) => Promise<any>) | string): void; | ||
@@ -437,25 +413,10 @@ /** | ||
* | ||
* If the callback signature contains the second optional done argument, | ||
* the callback will be passed a done callback to be called after the job has been completed. | ||
* The done callback can be called with an Error instance, to signal that the job did not complete successfully, | ||
* or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. | ||
* Errors will be passed as a second argument to the "failed" event; | ||
* results, as a second argument to the "completed" event. | ||
* or with a result as second argument (e.g.: done(null, result);) when the job is successful. | ||
* Errors will be passed as a second argument to the "failed" event; results, as a second argument to the "completed" event. | ||
* | ||
* @param name Bull will only call the handler if the job name matches | ||
*/ | ||
// tslint:disable-next-line:unified-signatures | ||
process(name: string, callback: (job: Job<T>, done: DoneCallback) => void): void; | ||
/** | ||
* Defines a named processing function for the jobs placed into a given Queue. | ||
* | ||
* The callback is called everytime a job is placed in the queue. | ||
* It is passed an instance of the job as first argument. | ||
* The callback can also be defined as the string path to a module | ||
* exporting the callback function. Using a path has several advantages: | ||
* - The process is sandboxed so if it crashes it does not affect the worker. | ||
* - You can run blocking code without affecting the queue (jobs will not stall). | ||
* - Much better utilization of multi-core CPUs. | ||
* - Less connections to redis. | ||
* | ||
* A promise must be returned to signal job completion. | ||
* If, however, the callback signature does not contain the done argument, | ||
* a promise must be returned to signal job completion. | ||
* If the promise is rejected, the error will be passed as a second argument to the "failed" event. | ||
@@ -465,23 +426,7 @@ * If it is resolved, its value will be the "completed" event's second argument. | ||
* @param name Bull will only call the handler if the job name matches | ||
* @param concurrency Bull will then call you handler in parallel respecting this max number. | ||
* @param concurrency Bull will then call your handler in parallel respecting this maximum value. | ||
*/ | ||
process(name: string, concurrency: number, callback: ((job: Job<T>) => void) | string): Promise<any>; | ||
process(name: string, concurrency: number, callback: ((job: Job<T>, done: DoneCallback) => void) | ((job: Job<T>) => Promise<any>) | string): void; | ||
/** | ||
* Defines a processing function for the jobs placed into a given Queue. | ||
* | ||
* The callback is called everytime a job is placed in the queue. | ||
* It is passed an instance of the job as first argument. | ||
* | ||
* The done callback can be called with an Error instance, to signal that the job did not complete successfully, | ||
* or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. | ||
* Errors will be passed as a second argument to the "failed" event; | ||
* results, as a second argument to the "completed" event. | ||
* | ||
* @param name Bull will only call the handler if the job name matches | ||
* @param concurrency Bull will then call you handler in parallel respecting this max number. | ||
*/ | ||
process(name: string, concurrency: number, callback: (job: Job<T>, done: DoneCallback) => void): void; | ||
/** | ||
* Creates a new job and adds it to the queue. | ||
@@ -488,0 +433,0 @@ * If the queue is empty the job will be executed directly, |
{ | ||
"name": "@types/bull", | ||
"version": "3.4.2", | ||
"version": "3.4.3", | ||
"description": "TypeScript definitions for bull", | ||
@@ -66,2 +66,7 @@ "license": "MIT", | ||
"githubUsername": "kjellmorten" | ||
}, | ||
{ | ||
"name": "Christian D.", | ||
"url": "https://github.com/pc-jedi", | ||
"githubUsername": "pc-jedi" | ||
} | ||
@@ -80,4 +85,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "a2dad1303fafd3346a0d79769d0cbddc89a09cdf7202cfa8872fbcf39ce486b7", | ||
"typesPublisherContentHash": "b664ad87b1ae79b105e8f14b4eca8511ea19efa4edd4b466dcb6dd9f3a5e832b", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Wed, 28 Nov 2018 20:35:49 GMT | ||
* Last updated: Thu, 29 Nov 2018 17:56:22 GMT | ||
* Dependencies: ioredis, bluebird | ||
@@ -17,2 +17,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by Bruno Grieder <https://github.com/bgrieder>, Cameron Crothers <https://github.com/JProgrammer>, Marshall Cottrell <https://github.com/marshall007>, Weeco <https://github.com/weeco>, Gabriel Terwesten <https://github.com/blaugold>, Oleg Repin <https://github.com/iamolegga>, David Koblas <https://github.com/koblas>, Bond Akinmade <https://github.com/bondz>, Wuha Team <https://github.com/wuha-team>, Alec Brunelle <https://github.com/aleccool213>, Dan Manastireanu <https://github.com/danmana>, Kjell-Morten Bratsberg Thorsen <https://github.com/kjellmorten>. | ||
These definitions were written by Bruno Grieder <https://github.com/bgrieder>, Cameron Crothers <https://github.com/JProgrammer>, Marshall Cottrell <https://github.com/marshall007>, Weeco <https://github.com/weeco>, Gabriel Terwesten <https://github.com/blaugold>, Oleg Repin <https://github.com/iamolegga>, David Koblas <https://github.com/koblas>, Bond Akinmade <https://github.com/bondz>, Wuha Team <https://github.com/wuha-team>, Alec Brunelle <https://github.com/aleccool213>, Dan Manastireanu <https://github.com/danmana>, Kjell-Morten Bratsberg Thorsen <https://github.com/kjellmorten>, Christian D. <https://github.com/pc-jedi>. |
29358
578