@promistream/simple-queue 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -1
- package/package.json +5 -5
- package/test.js +3 -3
package/index.js
CHANGED
|
@@ -33,7 +33,9 @@ module.exports = function createSimpleQueue(_initialItems, _options) {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
let stream = simpleSource(() => {
|
|
36
|
-
|
|
36
|
+
let valuesInBuffer = buffer.countLane().values + buffer.countInFlight();
|
|
37
|
+
|
|
38
|
+
if (isEnded === false && valuesInBuffer > 0) {
|
|
37
39
|
debug(`values available; requesting one`);
|
|
38
40
|
return buffer.request();
|
|
39
41
|
} else if (autoEnd === false) {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promistream/simple-queue",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": "http://git.cryto.net/promistream/simple-queue.git",
|
|
6
6
|
"author": "Sven Slootweg <admin@cryto.net>",
|
|
7
7
|
"license": "WTFPL OR CC0-1.0",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@promistream/aborted": "^0.1.2",
|
|
10
|
-
"@promistream/end-of-stream": "^0.1.
|
|
10
|
+
"@promistream/end-of-stream": "^0.1.2",
|
|
11
11
|
"@validatem/anything": "^0.1.0",
|
|
12
12
|
"@validatem/array-of": "^0.1.3",
|
|
13
13
|
"@validatem/core": "^0.6.0",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"debug-instanced": "^1.0.0",
|
|
18
18
|
"error-chain": "^0.1.3",
|
|
19
19
|
"match-value": "^1.1.0",
|
|
20
|
-
"push-buffer": "^1.
|
|
20
|
+
"push-buffer": "^1.5.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@promistream/collect": "^0.1.
|
|
24
|
-
"@promistream/parallelize": "^0.1.
|
|
23
|
+
"@promistream/collect": "^0.1.2",
|
|
24
|
+
"@promistream/parallelize": "^0.1.6",
|
|
25
25
|
"@promistream/pipe": "^0.1.6",
|
|
26
26
|
"@promistream/spy": "^0.1.0",
|
|
27
27
|
"bluebird": "^3.7.2"
|
package/test.js
CHANGED
|
@@ -23,7 +23,7 @@ test("basic functioning", async () => {
|
|
|
23
23
|
collect()
|
|
24
24
|
]).read();
|
|
25
25
|
|
|
26
|
-
assert(result, [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]);
|
|
26
|
+
assert.deepStrictEqual(result, [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]);
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
test("unbounded parallelism", async () => {
|
|
@@ -40,7 +40,7 @@ test("unbounded parallelism", async () => {
|
|
|
40
40
|
collect()
|
|
41
41
|
]).read();
|
|
42
42
|
|
|
43
|
-
assert(result, [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]);
|
|
43
|
+
assert.deepStrictEqual(result, [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]);
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
test("autoEnd = false", async () => {
|
|
@@ -59,5 +59,5 @@ test("autoEnd = false", async () => {
|
|
|
59
59
|
collect()
|
|
60
60
|
]).read();
|
|
61
61
|
|
|
62
|
-
assert(result, [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]);
|
|
62
|
+
assert.deepStrictEqual(result, [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]);
|
|
63
63
|
});
|