qdone 1.6.0 → 2.0.0-alpha
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/README.md +9 -1
- package/commonjs/index.js +10 -0
- package/commonjs/package.json +3 -0
- package/commonjs/src/cache.js +142 -0
- package/commonjs/src/cloudWatch.js +148 -0
- package/commonjs/src/consumer.js +483 -0
- package/commonjs/src/defaults.js +107 -0
- package/commonjs/src/enqueue.js +498 -0
- package/commonjs/src/idleQueues.js +466 -0
- package/commonjs/src/qrlCache.js +250 -0
- package/commonjs/src/sqs.js +160 -0
- package/npm-shrinkwrap.json +17598 -264
- package/package.json +41 -29
- package/src/bin.js +3 -0
- package/src/cache.js +21 -25
- package/src/cli.js +269 -181
- package/src/cloudWatch.js +97 -0
- package/src/consumer.js +346 -0
- package/src/defaults.js +114 -0
- package/src/enqueue.js +239 -196
- package/src/idleQueues.js +242 -223
- package/src/monitor.js +53 -0
- package/src/qrlCache.js +110 -83
- package/src/sentry.js +30 -0
- package/src/sqs.js +73 -0
- package/src/worker.js +197 -202
- package/.DS_Store +0 -0
- package/.coveralls.yml +0 -2
- package/.travis.yml +0 -17
- package/CHANGELOG.md +0 -107
- package/dump.rdb +0 -0
- package/index.js +0 -6
- package/package-lock.json.old +0 -3939
- package/qdone +0 -2
- package/test/fixtures/test-child-kill-linux.sh +0 -9
- package/test/fixtures/test-fifo01-x24.batch +0 -24
- package/test/fixtures/test-too-big-1.batch +0 -10
- package/test/fixtures/test-unique01-x24.batch +0 -24
- package/test/fixtures/test-unique02-x24.batch +0 -24
- package/test/fixtures/test-unique24-x24.batch +0 -24
- package/test/fixtures/test-unique24-x240.batch +0 -240
- package/test/test.cache.js +0 -61
- package/test/test.cli.js +0 -1609
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
test true
|
|
2
|
-
test true
|
|
3
|
-
test true
|
|
4
|
-
test true
|
|
5
|
-
test true
|
|
6
|
-
test true
|
|
7
|
-
test true
|
|
8
|
-
test true
|
|
9
|
-
test true
|
|
10
|
-
test true
|
|
11
|
-
test true
|
|
12
|
-
test true
|
|
13
|
-
test true
|
|
14
|
-
test true
|
|
15
|
-
test true
|
|
16
|
-
test true
|
|
17
|
-
test true
|
|
18
|
-
test true
|
|
19
|
-
test true
|
|
20
|
-
test true
|
|
21
|
-
test true
|
|
22
|
-
test true
|
|
23
|
-
test true
|
|
24
|
-
test true
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
test true
|
|
2
|
-
test1 true
|
|
3
|
-
test true
|
|
4
|
-
test1 true
|
|
5
|
-
test true
|
|
6
|
-
test1 true
|
|
7
|
-
test true
|
|
8
|
-
test1 true
|
|
9
|
-
test true
|
|
10
|
-
test1 true
|
|
11
|
-
test true
|
|
12
|
-
test1 true
|
|
13
|
-
test true
|
|
14
|
-
test1 true
|
|
15
|
-
test true
|
|
16
|
-
test1 true
|
|
17
|
-
test true
|
|
18
|
-
test1 true
|
|
19
|
-
test true
|
|
20
|
-
test1 true
|
|
21
|
-
test true
|
|
22
|
-
test1 true
|
|
23
|
-
test true
|
|
24
|
-
test1 true
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
test0 true
|
|
2
|
-
test1 true
|
|
3
|
-
test2 true
|
|
4
|
-
test3 true
|
|
5
|
-
test4 true
|
|
6
|
-
test5 true
|
|
7
|
-
test6 true
|
|
8
|
-
test7 true
|
|
9
|
-
test8 true
|
|
10
|
-
test9 true
|
|
11
|
-
test10 true
|
|
12
|
-
test11 true
|
|
13
|
-
test12 true
|
|
14
|
-
test13 true
|
|
15
|
-
test14 true
|
|
16
|
-
test15 true
|
|
17
|
-
test16 true
|
|
18
|
-
test17 true
|
|
19
|
-
test18 true
|
|
20
|
-
test19 true
|
|
21
|
-
test20 true
|
|
22
|
-
test21 true
|
|
23
|
-
test22 true
|
|
24
|
-
test23 true
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
test0 true
|
|
2
|
-
test1 true
|
|
3
|
-
test2 true
|
|
4
|
-
test3 true
|
|
5
|
-
test4 true
|
|
6
|
-
test5 true
|
|
7
|
-
test6 true
|
|
8
|
-
test7 true
|
|
9
|
-
test8 true
|
|
10
|
-
test9 true
|
|
11
|
-
test10 true
|
|
12
|
-
test11 true
|
|
13
|
-
test12 true
|
|
14
|
-
test13 true
|
|
15
|
-
test14 true
|
|
16
|
-
test15 true
|
|
17
|
-
test16 true
|
|
18
|
-
test17 true
|
|
19
|
-
test18 true
|
|
20
|
-
test19 true
|
|
21
|
-
test20 true
|
|
22
|
-
test21 true
|
|
23
|
-
test22 true
|
|
24
|
-
test23 true
|
|
25
|
-
test0 true
|
|
26
|
-
test1 true
|
|
27
|
-
test2 true
|
|
28
|
-
test3 true
|
|
29
|
-
test4 true
|
|
30
|
-
test5 true
|
|
31
|
-
test6 true
|
|
32
|
-
test7 true
|
|
33
|
-
test8 true
|
|
34
|
-
test9 true
|
|
35
|
-
test10 true
|
|
36
|
-
test11 true
|
|
37
|
-
test12 true
|
|
38
|
-
test13 true
|
|
39
|
-
test14 true
|
|
40
|
-
test15 true
|
|
41
|
-
test16 true
|
|
42
|
-
test17 true
|
|
43
|
-
test18 true
|
|
44
|
-
test19 true
|
|
45
|
-
test20 true
|
|
46
|
-
test21 true
|
|
47
|
-
test22 true
|
|
48
|
-
test23 true
|
|
49
|
-
test0 true
|
|
50
|
-
test1 true
|
|
51
|
-
test2 true
|
|
52
|
-
test3 true
|
|
53
|
-
test4 true
|
|
54
|
-
test5 true
|
|
55
|
-
test6 true
|
|
56
|
-
test7 true
|
|
57
|
-
test8 true
|
|
58
|
-
test9 true
|
|
59
|
-
test10 true
|
|
60
|
-
test11 true
|
|
61
|
-
test12 true
|
|
62
|
-
test13 true
|
|
63
|
-
test14 true
|
|
64
|
-
test15 true
|
|
65
|
-
test16 true
|
|
66
|
-
test17 true
|
|
67
|
-
test18 true
|
|
68
|
-
test19 true
|
|
69
|
-
test20 true
|
|
70
|
-
test21 true
|
|
71
|
-
test22 true
|
|
72
|
-
test23 true
|
|
73
|
-
test0 true
|
|
74
|
-
test1 true
|
|
75
|
-
test2 true
|
|
76
|
-
test3 true
|
|
77
|
-
test4 true
|
|
78
|
-
test5 true
|
|
79
|
-
test6 true
|
|
80
|
-
test7 true
|
|
81
|
-
test8 true
|
|
82
|
-
test9 true
|
|
83
|
-
test10 true
|
|
84
|
-
test11 true
|
|
85
|
-
test12 true
|
|
86
|
-
test13 true
|
|
87
|
-
test14 true
|
|
88
|
-
test15 true
|
|
89
|
-
test16 true
|
|
90
|
-
test17 true
|
|
91
|
-
test18 true
|
|
92
|
-
test19 true
|
|
93
|
-
test20 true
|
|
94
|
-
test21 true
|
|
95
|
-
test22 true
|
|
96
|
-
test23 true
|
|
97
|
-
test0 true
|
|
98
|
-
test1 true
|
|
99
|
-
test2 true
|
|
100
|
-
test3 true
|
|
101
|
-
test4 true
|
|
102
|
-
test5 true
|
|
103
|
-
test6 true
|
|
104
|
-
test7 true
|
|
105
|
-
test8 true
|
|
106
|
-
test9 true
|
|
107
|
-
test10 true
|
|
108
|
-
test11 true
|
|
109
|
-
test12 true
|
|
110
|
-
test13 true
|
|
111
|
-
test14 true
|
|
112
|
-
test15 true
|
|
113
|
-
test16 true
|
|
114
|
-
test17 true
|
|
115
|
-
test18 true
|
|
116
|
-
test19 true
|
|
117
|
-
test20 true
|
|
118
|
-
test21 true
|
|
119
|
-
test22 true
|
|
120
|
-
test23 true
|
|
121
|
-
test0 true
|
|
122
|
-
test1 true
|
|
123
|
-
test2 true
|
|
124
|
-
test3 true
|
|
125
|
-
test4 true
|
|
126
|
-
test5 true
|
|
127
|
-
test6 true
|
|
128
|
-
test7 true
|
|
129
|
-
test8 true
|
|
130
|
-
test9 true
|
|
131
|
-
test10 true
|
|
132
|
-
test11 true
|
|
133
|
-
test12 true
|
|
134
|
-
test13 true
|
|
135
|
-
test14 true
|
|
136
|
-
test15 true
|
|
137
|
-
test16 true
|
|
138
|
-
test17 true
|
|
139
|
-
test18 true
|
|
140
|
-
test19 true
|
|
141
|
-
test20 true
|
|
142
|
-
test21 true
|
|
143
|
-
test22 true
|
|
144
|
-
test23 true
|
|
145
|
-
test0 true
|
|
146
|
-
test1 true
|
|
147
|
-
test2 true
|
|
148
|
-
test3 true
|
|
149
|
-
test4 true
|
|
150
|
-
test5 true
|
|
151
|
-
test6 true
|
|
152
|
-
test7 true
|
|
153
|
-
test8 true
|
|
154
|
-
test9 true
|
|
155
|
-
test10 true
|
|
156
|
-
test11 true
|
|
157
|
-
test12 true
|
|
158
|
-
test13 true
|
|
159
|
-
test14 true
|
|
160
|
-
test15 true
|
|
161
|
-
test16 true
|
|
162
|
-
test17 true
|
|
163
|
-
test18 true
|
|
164
|
-
test19 true
|
|
165
|
-
test20 true
|
|
166
|
-
test21 true
|
|
167
|
-
test22 true
|
|
168
|
-
test23 true
|
|
169
|
-
test0 true
|
|
170
|
-
test1 true
|
|
171
|
-
test2 true
|
|
172
|
-
test3 true
|
|
173
|
-
test4 true
|
|
174
|
-
test5 true
|
|
175
|
-
test6 true
|
|
176
|
-
test7 true
|
|
177
|
-
test8 true
|
|
178
|
-
test9 true
|
|
179
|
-
test10 true
|
|
180
|
-
test11 true
|
|
181
|
-
test12 true
|
|
182
|
-
test13 true
|
|
183
|
-
test14 true
|
|
184
|
-
test15 true
|
|
185
|
-
test16 true
|
|
186
|
-
test17 true
|
|
187
|
-
test18 true
|
|
188
|
-
test19 true
|
|
189
|
-
test20 true
|
|
190
|
-
test21 true
|
|
191
|
-
test22 true
|
|
192
|
-
test23 true
|
|
193
|
-
test0 true
|
|
194
|
-
test1 true
|
|
195
|
-
test2 true
|
|
196
|
-
test3 true
|
|
197
|
-
test4 true
|
|
198
|
-
test5 true
|
|
199
|
-
test6 true
|
|
200
|
-
test7 true
|
|
201
|
-
test8 true
|
|
202
|
-
test9 true
|
|
203
|
-
test10 true
|
|
204
|
-
test11 true
|
|
205
|
-
test12 true
|
|
206
|
-
test13 true
|
|
207
|
-
test14 true
|
|
208
|
-
test15 true
|
|
209
|
-
test16 true
|
|
210
|
-
test17 true
|
|
211
|
-
test18 true
|
|
212
|
-
test19 true
|
|
213
|
-
test20 true
|
|
214
|
-
test21 true
|
|
215
|
-
test22 true
|
|
216
|
-
test23 true
|
|
217
|
-
test0 true
|
|
218
|
-
test1 true
|
|
219
|
-
test2 true
|
|
220
|
-
test3 true
|
|
221
|
-
test4 true
|
|
222
|
-
test5 true
|
|
223
|
-
test6 true
|
|
224
|
-
test7 true
|
|
225
|
-
test8 true
|
|
226
|
-
test9 true
|
|
227
|
-
test10 true
|
|
228
|
-
test11 true
|
|
229
|
-
test12 true
|
|
230
|
-
test13 true
|
|
231
|
-
test14 true
|
|
232
|
-
test15 true
|
|
233
|
-
test16 true
|
|
234
|
-
test17 true
|
|
235
|
-
test18 true
|
|
236
|
-
test19 true
|
|
237
|
-
test20 true
|
|
238
|
-
test21 true
|
|
239
|
-
test22 true
|
|
240
|
-
test23 true
|
package/test/test.cache.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/* eslint-env mocha */
|
|
2
|
-
|
|
3
|
-
const chai = require('chai')
|
|
4
|
-
const cache = require('../src/cache')
|
|
5
|
-
const expect = chai.expect
|
|
6
|
-
|
|
7
|
-
beforeEach(function () { cache.resetClient() })
|
|
8
|
-
after(function () { cache.resetClient() })
|
|
9
|
-
|
|
10
|
-
describe('cache', function () {
|
|
11
|
-
const options = {
|
|
12
|
-
'cache-uri': 'redis://localhost',
|
|
13
|
-
'cache-ttl-seconds': 10,
|
|
14
|
-
'cache-prefix': 'qdone:'
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
describe('getClient', function () {
|
|
18
|
-
it('should throw an error for invalid cache uri', function () {
|
|
19
|
-
const badOptions = Object.assign({}, options, {'cache-uri': 'bob://foo'})
|
|
20
|
-
expect(() => cache.getClient(badOptions)).to.throw(/currently supported/)
|
|
21
|
-
})
|
|
22
|
-
it('should throw an error when --cache-uri is missing', function () {
|
|
23
|
-
const badOptions = Object.assign({}, options)
|
|
24
|
-
delete badOptions['cache-uri']
|
|
25
|
-
expect(() => cache.getClient(badOptions)).to.throw(/--cache-uri/)
|
|
26
|
-
})
|
|
27
|
-
it('should support redis:// URIs', function () {
|
|
28
|
-
const client = cache.getClient(options)
|
|
29
|
-
return expect(client).to.be.ok
|
|
30
|
-
})
|
|
31
|
-
it('should support redis-cache:// URIs', function () {
|
|
32
|
-
const client = cache.getClient(Object.assign({}, options, {'cache-uri': 'redis-cluster://'}))
|
|
33
|
-
return expect(client).to.be.ok
|
|
34
|
-
})
|
|
35
|
-
it('should return an identical client on subsequent calls', function () {
|
|
36
|
-
const client1 = cache.getClient(options)
|
|
37
|
-
const client2 = cache.getClient(options)
|
|
38
|
-
return expect(client1).to.be.equal(client2)
|
|
39
|
-
})
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
describe('setCache', function () {
|
|
43
|
-
it('should successfully set a value', function () {
|
|
44
|
-
return cache.setCache('test', {one: 1}, options)
|
|
45
|
-
.then(result => expect(result).to.equal('OK'))
|
|
46
|
-
})
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
describe('getCache', function () {
|
|
50
|
-
it('should return the same value', function () {
|
|
51
|
-
return cache.getCache('test', options).then(
|
|
52
|
-
result => expect(JSON.stringify(result)).to.equal(JSON.stringify({one: 1}))
|
|
53
|
-
)
|
|
54
|
-
})
|
|
55
|
-
it('should return undefined for nonexistent keys', function () {
|
|
56
|
-
return cache.getCache('supercalafragalisticexpealadocious', options).then(
|
|
57
|
-
result => expect(result).to.be.undefined
|
|
58
|
-
)
|
|
59
|
-
})
|
|
60
|
-
})
|
|
61
|
-
})
|