Comparing version 5.0.1 to 6.0.0
@@ -96,2 +96,3 @@ var inherits = require('inherits') | ||
var resultIndex = null | ||
var timeout = job.timeout || this.timeout | ||
@@ -126,3 +127,3 @@ function next (err, result) { | ||
if (this.timeout) { | ||
if (timeout) { | ||
timeoutId = setTimeout(function () { | ||
@@ -135,3 +136,3 @@ didTimeout = true | ||
} | ||
}, this.timeout) | ||
}, timeout) | ||
this.timers[timeoutId] = timeoutId | ||
@@ -146,2 +147,3 @@ } | ||
this.pending++ | ||
self.emit('start', job) | ||
var promise = job(next) | ||
@@ -148,0 +150,0 @@ if (promise && promise.then && typeof promise.then === 'function') { |
{ | ||
"name": "queue", | ||
"version": "5.0.1", | ||
"version": "6.0.0", | ||
"description": "asynchronous function queue with adjustable concurrency", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -79,2 +79,14 @@ ``` | ||
// jobs can also override the queue's timeout | ||
// on a per-job basis | ||
function extraSlowJob (cb) { | ||
setTimeout(function () { | ||
console.log('extra slow job finished') | ||
cb() | ||
}, 400) | ||
} | ||
extraSlowJob.timeout = 500 | ||
q.push(extraSlowJob) | ||
// get notified when jobs complete | ||
@@ -138,3 +150,3 @@ q.on('success', function (result, job) { | ||
### `q.timeout` | ||
Milliseconds to wait for a job to execute its callback. | ||
Milliseconds to wait for a job to execute its callback. This can be overridden by specifying a `timeout` property on a per-job basis. | ||
@@ -152,2 +164,5 @@ ### `q.autostart` | ||
### `q.emit('start', job)` | ||
Immediately before a job begins to execute. | ||
### `q.emit('success', result, job)` | ||
@@ -167,2 +182,5 @@ After a job executes its callback. | ||
The latest stable release is published to [npm](http://npmjs.org/queue). Abbreviated changelog below: | ||
* [6.0](https://github.com/jessetane/queue/archive/6.0.0.tar.gz) | ||
* Add `start` event before job begins (@joelgriffith) | ||
* Add `timeout` property on a job to override the queue's timeout (@joelgriffith) | ||
* [5.0](https://github.com/jessetane/queue/archive/5.0.0.tar.gz) | ||
@@ -169,0 +187,0 @@ * Updated TypeScript bindings (@Codex-) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17201
307
210