@theotherwillembotha/node-red-circuitbreaker 0.0.53 → 0.0.55
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 +11 -0
- package/build/Plugins.js +2 -2
- package/build/circuitbreaker/node/CircuitBreakerEventNode.js +1 -1
- package/build/circuitbreaker/node/CircuitBreakerFaultDetectorNode.js +1 -1
- package/build/circuitbreaker/node/CircuitBreakerNode.js +1 -1
- package/build/circuitbreaker/node/CircuitBreakerStateNode.js +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -4,6 +4,17 @@ Circuit Breaker nodes for Node-RED with configurable fault detection, trip condi
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
> [!IMPORTANT]
|
|
8
|
+
> **This plugin requires [`@theotherwillembotha/node-red-plugincore`](https://github.com/theotherwillembotha/nodered_plugincore) to be installed.**
|
|
9
|
+
>
|
|
10
|
+
> `node-red-plugincore` is declared as a dependency and npm will install it automatically alongside this package. However, due to a [known Node-RED limitation](https://github.com/node-red/node-red/issues/3529), packages that arrive as transitive npm dependencies are only discovered by the Node-RED runtime on the **next startup**.
|
|
11
|
+
>
|
|
12
|
+
> **You have two options:**
|
|
13
|
+
> - Install [`@theotherwillembotha/node-red-plugincore`](https://flows.nodered.org/node/@theotherwillembotha/node-red-plugincore) via the palette manager or `npm install` **first**, then install this plugin — both will be available immediately without a restart.
|
|
14
|
+
> - Install this plugin directly — `node-red-plugincore` will be installed automatically alongside it. **Restart Node-RED** once and both packages will be fully loaded.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
7
18
|
## What is a Circuit Breaker?
|
|
8
19
|
|
|
9
20
|
A circuit breaker is a resilience pattern that protects high-volume flows from cascading failures. When an external dependency (an HTTP endpoint, a database, a third-party service) starts failing, a circuit breaker can detect the fault, stop sending requests to the failing system, and give it time to recover, rather than hammering it with traffic and making the situation worse.
|
package/build/Plugins.js
CHANGED
|
@@ -42,7 +42,7 @@ module.exports = function (RED) {
|
|
|
42
42
|
RED.events.on('runtime-event', async (event) => {
|
|
43
43
|
// startup deployment.
|
|
44
44
|
if ("runtime-deploy" === event?.id && startupDeployment) {
|
|
45
|
-
console.log("STARTUP DEPLOYMENT");
|
|
45
|
+
//console.log("STARTUP DEPLOYMENT");
|
|
46
46
|
startupDeployment = false;
|
|
47
47
|
const flows = await runtime.flows.getFlows({});
|
|
48
48
|
await plugin.instance.onDeploy(flows);
|
|
@@ -50,7 +50,7 @@ module.exports = function (RED) {
|
|
|
50
50
|
|
|
51
51
|
// stopping flows on redeployment.
|
|
52
52
|
if ("runtime-state" === event?.id && event?.payload?.state === "stop" && event?.payload?.deploy) {
|
|
53
|
-
console.log("REDEPLOY!");
|
|
53
|
+
//console.log("REDEPLOY!");
|
|
54
54
|
const flows = await runtime.flows.getFlows({});
|
|
55
55
|
await plugin.instance.onDeploy(flows);
|
|
56
56
|
}
|
|
@@ -38,7 +38,7 @@ let CircuitBreakerEventNode = class CircuitBreakerEventNode extends node_red_plu
|
|
|
38
38
|
exports.CircuitBreakerEventNode = CircuitBreakerEventNode;
|
|
39
39
|
__decorate([
|
|
40
40
|
(0, node_red_plugincore_3.Logger)(),
|
|
41
|
-
__metadata("design:type",
|
|
41
|
+
__metadata("design:type", node_red_plugincore_3.Log)
|
|
42
42
|
], CircuitBreakerEventNode.prototype, "log", void 0);
|
|
43
43
|
__decorate([
|
|
44
44
|
(0, node_red_plugincore_2.Metrics)({ name: "tripCounter", type: node_red_plugincore_2.MetricType.Counter, description: "number of times the circuit breaker tripped" }),
|
|
@@ -44,7 +44,7 @@ let CircuitBreakerFaultDetectorNode = class CircuitBreakerFaultDetectorNode exte
|
|
|
44
44
|
exports.CircuitBreakerFaultDetectorNode = CircuitBreakerFaultDetectorNode;
|
|
45
45
|
__decorate([
|
|
46
46
|
(0, node_red_plugincore_3.Logger)(),
|
|
47
|
-
__metadata("design:type",
|
|
47
|
+
__metadata("design:type", node_red_plugincore_3.Log)
|
|
48
48
|
], CircuitBreakerFaultDetectorNode.prototype, "log", void 0);
|
|
49
49
|
__decorate([
|
|
50
50
|
(0, node_red_plugincore_2.Metrics)({ name: "counter", type: node_red_plugincore_2.MetricType.Counter, description: "number of requests received" }),
|
|
@@ -44,7 +44,7 @@ let CircuitBreakerNode = class CircuitBreakerNode extends node_red_plugincore_1.
|
|
|
44
44
|
exports.CircuitBreakerNode = CircuitBreakerNode;
|
|
45
45
|
__decorate([
|
|
46
46
|
(0, node_red_plugincore_3.Logger)(),
|
|
47
|
-
__metadata("design:type",
|
|
47
|
+
__metadata("design:type", node_red_plugincore_3.Log)
|
|
48
48
|
], CircuitBreakerNode.prototype, "log", void 0);
|
|
49
49
|
__decorate([
|
|
50
50
|
(0, node_red_plugincore_2.Metrics)({ name: "closeCounter", type: node_red_plugincore_2.MetricType.Counter, description: "number of requests processed while circuit breaker closed" }),
|
|
@@ -42,7 +42,7 @@ let CircuitBreakerStateNode = class CircuitBreakerStateNode extends node_red_plu
|
|
|
42
42
|
exports.CircuitBreakerStateNode = CircuitBreakerStateNode;
|
|
43
43
|
__decorate([
|
|
44
44
|
(0, node_red_plugincore_3.Logger)(),
|
|
45
|
-
__metadata("design:type",
|
|
45
|
+
__metadata("design:type", node_red_plugincore_3.Log)
|
|
46
46
|
], CircuitBreakerStateNode.prototype, "log", void 0);
|
|
47
47
|
__decorate([
|
|
48
48
|
(0, node_red_plugincore_2.Metrics)({ name: "counter", type: node_red_plugincore_2.MetricType.Counter, description: "number of messages received" }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theotherwillembotha/node-red-circuitbreaker",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.55",
|
|
4
4
|
"description": "Circuit Breaker nodes for Node-RED with configurable fault detection, trip conditions, and state management.",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"exports": "./build/index.js",
|
|
@@ -40,13 +40,16 @@
|
|
|
40
40
|
"nodered": ">=4.0.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@theotherwillembotha/node-red-plugincore": "^0.0.
|
|
43
|
+
"@theotherwillembotha/node-red-plugincore": "^0.0.55"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@theotherwillembotha/node-red-plugincore": "../nodered_plugincore",
|
|
47
47
|
"@types/node": "^22.15.16",
|
|
48
48
|
"@types/node-red": "~1.3.5"
|
|
49
49
|
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
50
53
|
"node-red": {
|
|
51
54
|
"version": ">=4.0.0",
|
|
52
55
|
"nodes": {
|