amqplib 0.10.3 → 0.10.4
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/.github/ISSUE_TEMPLATE/bug_report.md +7 -4
- package/.github/workflows/test.yml +15 -2
- package/CHANGELOG.md +6 -1
- package/Makefile +3 -4
- package/README.md +1 -1
- package/bin/generate-defs.js +5 -5
- package/examples/direct_reply_to_client.js +22 -0
- package/examples/direct_reply_to_server.js +25 -0
- package/examples/headers.js +29 -31
- package/examples/ssl.js +16 -10
- package/examples/stream_queues/README.md +40 -0
- package/examples/stream_queues/package.json +14 -0
- package/examples/stream_queues/receive_stream.js +55 -0
- package/examples/stream_queues/send_stream.js +38 -0
- package/examples/tutorials/callback_api/emit_log.js +22 -22
- package/examples/tutorials/callback_api/emit_log_direct.js +24 -24
- package/examples/tutorials/callback_api/emit_log_topic.js +23 -20
- package/examples/tutorials/callback_api/new_task.js +21 -20
- package/examples/tutorials/callback_api/receive.js +27 -21
- package/examples/tutorials/callback_api/receive_logs.js +32 -26
- package/examples/tutorials/callback_api/receive_logs_direct.js +42 -41
- package/examples/tutorials/callback_api/receive_logs_topic.js +43 -40
- package/examples/tutorials/callback_api/rpc_client.js +39 -37
- package/examples/tutorials/callback_api/rpc_server.js +42 -32
- package/examples/tutorials/callback_api/send.js +21 -22
- package/examples/tutorials/callback_api/worker.js +29 -25
- package/examples/tutorials/emit_log.js +20 -15
- package/examples/tutorials/emit_log_direct.js +22 -16
- package/examples/tutorials/emit_log_topic.js +22 -15
- package/examples/tutorials/new_task.js +20 -13
- package/examples/tutorials/receive.js +19 -14
- package/examples/tutorials/receive_logs.js +25 -23
- package/examples/tutorials/receive_logs_direct.js +29 -35
- package/examples/tutorials/receive_logs_topic.js +28 -32
- package/examples/tutorials/rpc_client.js +37 -40
- package/examples/tutorials/rpc_server.js +36 -29
- package/examples/tutorials/send.js +26 -18
- package/examples/tutorials/worker.js +27 -21
- package/examples/waitForConfirms.js +18 -19
- package/lib/callback_model.js +295 -290
- package/lib/channel.js +353 -346
- package/lib/channel_model.js +5 -1
- package/lib/codec.js +2 -2
- package/lib/connection.js +542 -527
- package/lib/credentials.js +1 -1
- package/lib/defs.js +2568 -2457
- package/lib/format.js +0 -1
- package/lib/heartbeat.js +32 -29
- package/lib/mux.js +96 -99
- package/package.json +1 -1
- package/test/callback_api.js +182 -174
- package/test/channel_api.js +455 -445
- package/test/codec.js +4 -4
- package/test/frame.js +5 -5
package/lib/channel_model.js
CHANGED
|
@@ -26,6 +26,10 @@ class ChannelModel extends EventEmitter {
|
|
|
26
26
|
return promisify(this.connection.close.bind(this.connection))();
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
updateSecret(newSecret, reason) {
|
|
30
|
+
return promisify(this.connection._updateSecret.bind(this.connection))(newSecret, reason);
|
|
31
|
+
}
|
|
32
|
+
|
|
29
33
|
async createChannel() {
|
|
30
34
|
const channel = new Channel(this.connection);
|
|
31
35
|
await channel.open();
|
|
@@ -264,7 +268,7 @@ Channel.prototype.prefetch = Channel.prototype.qos
|
|
|
264
268
|
class ConfirmChannel extends Channel {
|
|
265
269
|
publish(exchange, routingKey, content, options, cb) {
|
|
266
270
|
this.pushConfirmCallback(cb);
|
|
267
|
-
return
|
|
271
|
+
return super.publish(exchange, routingKey, content, options);
|
|
268
272
|
}
|
|
269
273
|
|
|
270
274
|
sendToQueue(queue, content, options, cb) {
|
package/lib/codec.js
CHANGED
|
@@ -262,7 +262,7 @@ function decodeFields(slice) {
|
|
|
262
262
|
break;
|
|
263
263
|
case 'F':
|
|
264
264
|
len = slice.readUInt32BE(offset); offset += 4;
|
|
265
|
-
val = decodeFields(slice.
|
|
265
|
+
val = decodeFields(slice.subarray(offset, offset + len));
|
|
266
266
|
offset += len;
|
|
267
267
|
break;
|
|
268
268
|
case 'A':
|
|
@@ -290,7 +290,7 @@ function decodeFields(slice) {
|
|
|
290
290
|
break;
|
|
291
291
|
case 'x':
|
|
292
292
|
len = slice.readUInt32BE(offset); offset += 4;
|
|
293
|
-
val = slice.
|
|
293
|
+
val = slice.subarray(offset, offset + len);
|
|
294
294
|
offset += len;
|
|
295
295
|
break;
|
|
296
296
|
default:
|