amqplib 0.5.5 → 0.7.1
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/CHANGELOG.md +43 -3
- package/Makefile +3 -2
- package/README.md +1 -1
- package/bin/generate-defs.js +1 -1
- package/examples/tutorials/package.json +1 -1
- package/lib/defs.js +166 -184
- package/lib/mux.js +6 -21
- package/package-lock.json +942 -30
- package/package.json +6 -6
- package/test/frame.js +1 -1
- package/test/mux.js +37 -3
package/package.json
CHANGED
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
"name": "amqplib",
|
|
3
3
|
"homepage": "http://squaremo.github.io/amqp.node/",
|
|
4
4
|
"main": "./channel_api.js",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.7.1",
|
|
6
6
|
"description": "An AMQP 0-9-1 (e.g., RabbitMQ) library and client.",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/squaremo/amqp.node.git"
|
|
10
10
|
},
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": ">=0.8 <=
|
|
12
|
+
"node": ">=0.8 <=15"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"bitsyntax": "~0.1.0",
|
|
16
|
-
"bluebird": "^3.
|
|
16
|
+
"bluebird": "^3.7.2",
|
|
17
17
|
"buffer-more-ints": "~1.0.0",
|
|
18
18
|
"readable-stream": "1.x >=1.1.9",
|
|
19
|
-
"safe-buffer": "~5.1
|
|
20
|
-
"url-parse": "~1.
|
|
19
|
+
"safe-buffer": "~5.2.1",
|
|
20
|
+
"url-parse": "~1.5.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"claire": "0.4.1",
|
|
24
24
|
"istanbul": "0.1.x",
|
|
25
25
|
"mocha": "^3.5.3",
|
|
26
|
-
"uglify-js": "2.
|
|
26
|
+
"uglify-js": "2.8.x"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"test": "make test",
|
package/test/frame.js
CHANGED
|
@@ -123,7 +123,7 @@ suite("Parsing", function() {
|
|
|
123
123
|
bufs.push(defs.encodeMethod(f.id, 0, f.fields));
|
|
124
124
|
});
|
|
125
125
|
|
|
126
|
-
partition(bufs).forEach(input.write
|
|
126
|
+
partition(bufs).forEach(function (chunk) { input.write(chunk); });
|
|
127
127
|
frames.acceptLoop();
|
|
128
128
|
if (ex) throw ex;
|
|
129
129
|
return i === t.length;
|
package/test/mux.js
CHANGED
|
@@ -41,7 +41,7 @@ test("single input", function(done) {
|
|
|
41
41
|
// not 0, it's treated specially by PassThrough for some reason. By
|
|
42
42
|
// 'specially' I mean it breaks the stream. See e.g.,
|
|
43
43
|
// https://github.com/isaacs/readable-stream/pull/55
|
|
44
|
-
data.forEach(input.write
|
|
44
|
+
data.forEach(function (chunk) { input.write(chunk); });
|
|
45
45
|
|
|
46
46
|
readAllObjects(output, function(vals) {
|
|
47
47
|
assert.deepEqual(data, vals);
|
|
@@ -51,6 +51,40 @@ test("single input", function(done) {
|
|
|
51
51
|
input.end();
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
+
test("single input, resuming stream", function(done) {
|
|
55
|
+
var input = stream();
|
|
56
|
+
var output = stream();
|
|
57
|
+
input.on('end', function() { output.end() });
|
|
58
|
+
|
|
59
|
+
var mux = new Mux(output);
|
|
60
|
+
mux.pipeFrom(input);
|
|
61
|
+
|
|
62
|
+
// Streams might be blocked and become readable again, simulate this
|
|
63
|
+
// using a special read function and a marker
|
|
64
|
+
var data = [1,2,3,4,'skip',6,7,8,9];
|
|
65
|
+
|
|
66
|
+
var oldRead = input.read;
|
|
67
|
+
input.read = function(size) {
|
|
68
|
+
var val = oldRead.call(input, size)
|
|
69
|
+
|
|
70
|
+
if (val === 'skip') {
|
|
71
|
+
input.emit('readable');
|
|
72
|
+
return null
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return val;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
data.forEach(function (chunk) { input.write(chunk); });
|
|
79
|
+
|
|
80
|
+
readAllObjects(output, function(vals) {
|
|
81
|
+
assert.deepEqual([1,2,3,4,6,7,8,9], vals);
|
|
82
|
+
done();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
input.end();
|
|
86
|
+
});
|
|
87
|
+
|
|
54
88
|
test("two sequential inputs", function(done) {
|
|
55
89
|
var input1 = stream();
|
|
56
90
|
var input2 = stream();
|
|
@@ -111,13 +145,13 @@ test("unpipe", function(done) {
|
|
|
111
145
|
mux.pipeFrom(input);
|
|
112
146
|
|
|
113
147
|
schedule(function() {
|
|
114
|
-
pipedData.forEach(input.write
|
|
148
|
+
pipedData.forEach(function (chunk) { input.write(chunk); });
|
|
115
149
|
|
|
116
150
|
schedule(function() {
|
|
117
151
|
mux.unpipeFrom(input);
|
|
118
152
|
|
|
119
153
|
schedule(function() {
|
|
120
|
-
unpipedData.forEach(input.write
|
|
154
|
+
unpipedData.forEach(function(chunk) { input.write(chunk); });
|
|
121
155
|
input.end();
|
|
122
156
|
schedule(function() {
|
|
123
157
|
// exhaust so that 'end' fires
|