rascal 20.1.1 → 21.0.0
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 +6 -0
- package/README.md +0 -4
- package/examples/default-exchange/index.js +10 -11
- package/lib/backoff/linear.js +6 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 21.0.0
|
|
4
|
+
- **BREAKING**: Drop Node.js 14 support (EOL since April 2023). Minimum Node.js version is now 16.
|
|
5
|
+
|
|
6
|
+
## 20.1.2
|
|
7
|
+
- Remove codeclimate (it's been sold) until we have time to replace get it working again.
|
|
8
|
+
|
|
3
9
|
## 20.1.1
|
|
4
10
|
- npm search algorithm has changed. Updating metadata accordingly.
|
|
5
11
|
|
package/README.md
CHANGED
|
@@ -5,10 +5,6 @@ Rascal is an advanced RabbitMQ / AMQP client built on [amqplib](https://www.npmj
|
|
|
5
5
|
[](https://www.npmjs.com/package/rascal)
|
|
6
6
|
[](https://www.npmjs.com/package/rascal)
|
|
7
7
|
[](https://github.com/onebeyond/rascal/actions?query=workflow%3A%22Node.js+CI%22)
|
|
8
|
-
[](https://codeclimate.com/github/onebeyond/rascal)
|
|
9
|
-
[](https://codeclimate.com/github/onebeyond/rascal/coverage)
|
|
10
|
-
[](https://snyk.io/advisor/npm-package/rascal)
|
|
11
|
-
[](https://www.npmjs.com/package/zunit)
|
|
12
8
|
|
|
13
9
|
## About
|
|
14
10
|
|
|
@@ -4,17 +4,16 @@ var config = require('./config');
|
|
|
4
4
|
Rascal.Broker.create(Rascal.withDefaultConfig(config), function (err, broker) {
|
|
5
5
|
if (err) throw err;
|
|
6
6
|
|
|
7
|
-
broker
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.on('error', console.error);
|
|
7
|
+
broker.subscribe('demo_sub', function (err, subscription) {
|
|
8
|
+
if (err) throw err;
|
|
9
|
+
subscription
|
|
10
|
+
.on('message', function (message, content, ackOrNack) {
|
|
11
|
+
console.log(content);
|
|
12
|
+
ackOrNack();
|
|
13
|
+
})
|
|
14
|
+
.on('error', console.error);
|
|
15
|
+
});
|
|
16
|
+
broker.on('error', console.error);
|
|
18
17
|
|
|
19
18
|
setInterval(function () {
|
|
20
19
|
broker.publish('demo_pub', new Date().toISOString() + ': hello world', 'demo_q', function (err, publication) {
|
package/lib/backoff/linear.js
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const max = get(options, 'max', min);
|
|
1
|
+
module.exports = function (options = {}) {
|
|
2
|
+
const min = options.min || 1000;
|
|
3
|
+
const max = options.max || min;
|
|
4
|
+
const range = max - min;
|
|
6
5
|
|
|
7
6
|
function next() {
|
|
8
|
-
return Math.floor(Math.random() * (
|
|
7
|
+
return range === 0 ? min : Math.floor(Math.random() * (range + 1) + min);
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
function reset() {}
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
next,
|
|
16
|
-
reset,
|
|
17
|
-
};
|
|
10
|
+
return { next, reset: () => {} };
|
|
18
11
|
};
|