Comparing version 1.6.0 to 1.6.1
{ | ||
"name": "fastq", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "Fast, in memory work queue", | ||
"main": "queue.js", | ||
"scripts": { | ||
"lint": "standard", | ||
"lint": "standard --verbose | snazzy", | ||
"unit": "nyc --lines 100 --branches 100 --functions 100 --check-coverage --reporter=text tape test/test.js", | ||
"coverage": "nyc --reporter=html --reporter=cobertura --reporter=text tape test/test.js", | ||
"test:report": "npm run lint && npm run unit:report", | ||
"test": "npm run lint && npm run unit && npm run typescript", | ||
"typescript": "tsc --project ./test/tsconfig.json", | ||
"test": "standard && tape test/test.js | tap-spec && npm run typescript" | ||
"legacy": "tape test/test.js" | ||
}, | ||
"pre-commit": [ | ||
"lint", | ||
"test" | ||
@@ -32,13 +35,14 @@ ], | ||
"devDependencies": { | ||
"async": "^2.6.1", | ||
"neo-async": "^2.5.1", | ||
"async": "^3.1.0", | ||
"neo-async": "^2.6.1", | ||
"nyc": "^15.0.0", | ||
"pre-commit": "^1.2.2", | ||
"standard": "^11.0.0", | ||
"tap-spec": "^4.1.2", | ||
"tape": "^4.9.0", | ||
"typescript": "^2.9.1" | ||
"snazzy": "^8.0.0", | ||
"standard": "^14.0.0", | ||
"tape": "^4.13.0", | ||
"typescript": "^3.5.3" | ||
}, | ||
"dependencies": { | ||
"reusify": "^1.0.0" | ||
"reusify": "^1.0.4" | ||
} | ||
} |
@@ -1,3 +0,7 @@ | ||
# fastq [![build status](https://secure.travis-ci.org/mcollina/fastq.png)](http://travis-ci.org/mcollina/fastq) | ||
# fastq | ||
![ci][ci-url] | ||
[![npm version][npm-badge]][npm-url] | ||
[![Dependency Status][david-badge]][david-url] | ||
Fast, in memory work queue. `fastq` is API compatible with | ||
@@ -8,8 +12,8 @@ [`async.queue`](https://github.com/caolan/async#queueworker-concurrency) | ||
* setImmediate: 1359ms | ||
* fastq: 1492ms | ||
* async.queue: 4039ms | ||
* neoAsync.queue: 4476ms | ||
* setImmediate: 812ms | ||
* fastq: 854ms | ||
* async.queue: 1298ms | ||
* neoAsync.queue: 1249ms | ||
Obtained on node 4.2.2, on a MacBook Pro 2014 (i7, 16GB of RAM). | ||
Obtained on node 12.16.1, on a dedicated server. | ||
@@ -23,5 +27,5 @@ If you need zero-overhead series function call, check out | ||
* <a href="#install">Installation</a> | ||
* <a href="#basic">Basic Example</a> | ||
* <a href="#usage">Usage</a> | ||
* <a href="#api">API</a> | ||
* <a href="#licence">Licence & copyright</a> | ||
* <a href="#license">Licence & copyright</a> | ||
@@ -186,1 +190,7 @@ ## Install | ||
ISC | ||
[ci-url]: https://github.com/mcollina/fastq/workflows/ci/badge.svg | ||
[npm-badge]: https://badge.fury.io/js/fastq.svg | ||
[npm-url]: https://badge.fury.io/js/fastq | ||
[david-badge]: https://david-dm.org/mcollina/fastq.svg | ||
[david-url]: https://david-dm.org/mcollina/fastq |
@@ -82,3 +82,2 @@ 'use strict' | ||
function worker (arg, cb) { | ||
console.log('received', arg) | ||
t.equal(arg, toExec[count], 'arg matches') | ||
@@ -148,2 +147,3 @@ count++ | ||
queue.resume() | ||
queue.resume() // second resume is a no-op | ||
@@ -159,2 +159,31 @@ t.notOk(queue.paused, 'it should not be paused') | ||
test('pause in flight && resume', function (t) { | ||
t.plan(9) | ||
var queue = buildQueue(worker, 1) | ||
var expected = [42, 24] | ||
t.notOk(queue.paused, 'it should not be paused') | ||
queue.push(42, function (err, result) { | ||
t.error(err, 'no error') | ||
t.equal(result, true, 'result matches') | ||
t.ok(queue.paused, 'it should be paused') | ||
process.nextTick(function () { queue.resume() }) | ||
}) | ||
queue.push(24, function (err, result) { | ||
t.error(err, 'no error') | ||
t.equal(result, true, 'result matches') | ||
t.notOk(queue.paused, 'it should not be paused') | ||
}) | ||
queue.pause() | ||
function worker (arg, cb) { | ||
t.equal(arg, expected.shift()) | ||
process.nextTick(function () { cb(null, true) }) | ||
} | ||
}) | ||
test('altering concurrency', function (t) { | ||
@@ -161,0 +190,0 @@ t.plan(7) |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
24028
643
194
0
8
Updatedreusify@^1.0.4