amqplib 0.5.5 → 0.5.6

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 CHANGED
@@ -1,8 +1,8 @@
1
1
  # Change log for amqplib
2
2
 
3
- ## Changes in v0.5.4
3
+ ## Changes in v0.5.5
4
4
 
5
- git log v0.5.3..v0.5.4
5
+ git log v0.5.3..v0.5.5
6
6
 
7
7
  **NB** this includes a minor but possibly breaking change: after [PR
8
8
  498](https://github.com/squaremo/amqp.node/pull/498), all confirmation
@@ -16,9 +16,14 @@ channel is closed.
16
16
  498](https://github.com/squaremo/amqp.node/pull/498)); thanks
17
17
  @johanneswuerbach
18
18
  * Update supported NodeJS versions in package.json ([PR
19
- 525](https://github.com/squaremo/amqp.node/pull/525)); thenks
19
+ 525](https://github.com/squaremo/amqp.node/pull/525)); thanks
20
20
  @tingwai
21
21
 
22
+ ## (Deprecated v0.5.4)
23
+
24
+ This release was mistakenly published without the generated file
25
+ `./defs.js`. It has been deprecated in favour of v0.5.5.
26
+
22
27
  ## Changes in v0.5.3
23
28
 
24
29
  git log v0.5.2..v0.5.3
@@ -124,7 +124,7 @@ println('var encodeTable = codec.encodeTable;');
124
124
  println('var decodeFields = codec.decodeFields;');
125
125
  nl();
126
126
 
127
- println('var SCRATCH = Buffer.alloc(16384);');
127
+ println('var SCRATCH = Buffer.alloc(65536);');
128
128
  println('var EMPTY_OBJECT = Object.freeze({});');
129
129
 
130
130
  println('module.exports.constants = %s',
@@ -5,7 +5,7 @@
5
5
  "main": "send.js",
6
6
  "dependencies": {
7
7
  "amqplib": "../..",
8
- "node-uuid": "*"
8
+ "uuid": "*"
9
9
  },
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1"
package/lib/defs.js CHANGED
@@ -3077,7 +3077,7 @@ function decodeBasicProperties(buffer) {
3077
3077
  return fields;
3078
3078
  }
3079
3079
 
3080
- var Buffer = require("safe-buffer").Buffer, codec = require("./codec"), ints = require("buffer-more-ints"), encodeTable = codec.encodeTable, decodeFields = codec.decodeFields, SCRATCH = Buffer.alloc(16384), EMPTY_OBJECT = Object.freeze({});
3080
+ var Buffer = require("safe-buffer").Buffer, codec = require("./codec"), ints = require("buffer-more-ints"), encodeTable = codec.encodeTable, decodeFields = codec.decodeFields, SCRATCH = Buffer.alloc(65536), EMPTY_OBJECT = Object.freeze({});
3081
3081
 
3082
3082
  module.exports.constants = {
3083
3083
  FRAME_METHOD: 1,
package/lib/mux.js CHANGED
@@ -55,26 +55,11 @@ Mux.prototype._readIncoming = function() {
55
55
  // are empty, or we exhaust our ability to accept chunks.
56
56
  function roundrobin(streams) {
57
57
  var s;
58
- // if there's just one incoming stream we don't have to
59
- // go through all the dequeue/enqueueing
60
- if (streams.length === 1) {
61
- s = streams.shift();
62
- while (accepting) {
63
- var chunk = s.read();
64
- if (chunk !== null) {
65
- accepting = out.write(chunk);
66
- }
67
- else break;
68
- }
69
- if (!accepting) streams.push(s);
70
- }
71
- else {
72
- while (accepting && (s = streams.shift())) {
73
- var chunk = s.read();
74
- if (chunk !== null) {
75
- accepting = out.write(chunk);
76
- streams.push(s);
77
- }
58
+ while (accepting && (s = streams.shift())) {
59
+ var chunk = s.read();
60
+ if (chunk !== null) {
61
+ accepting = out.write(chunk);
62
+ streams.push(s);
78
63
  }
79
64
  }
80
65
  }
@@ -105,7 +90,7 @@ Mux.prototype._readIncoming = function() {
105
90
 
106
91
  Mux.prototype._scheduleRead = function() {
107
92
  var self = this;
108
-
93
+
109
94
  if (!self.scheduledRead) {
110
95
  schedule(function() {
111
96
  self.scheduledRead = false;
package/package-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amqplib",
3
- "version": "0.5.3",
3
+ "version": "0.5.6",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "amqplib",
3
3
  "homepage": "http://squaremo.github.io/amqp.node/",
4
4
  "main": "./channel_api.js",
5
- "version": "0.5.5",
5
+ "version": "0.5.6",
6
6
  "description": "An AMQP 0-9-1 (e.g., RabbitMQ) library and client.",
7
7
  "repository": {
8
8
  "type": "git",
package/test/mux.js CHANGED
@@ -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(input.write.bind(input));
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();