Registry / devops / node-red-contrib-semaphore

node-red-contrib-semaphore

JSON →
library1.0.1jsnpmunverified

A Node-RED node that provides semaphore functionality to limit concurrent access to resources. Version 1.0.1 is the current stable release. The package is simple and focused, offering two nodes: 'semaphore take' and 'semaphore leave'. It queues messages on a semaphore with configurable capacity. No frequent updates; maintained for basic needs. Differentiator: native Node-RED integration for flow control and resource limiting.

npm install node-red-contrib-semaphore
INSTALL
IMPORT
SIG · NODE-RED-CONTRIB-S
N
node-red-contrib-semaphore
devopsjavascriptv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Node-RED node
Install via npm in Node-RED directory and use nodes in flows
Direct require in custom JavaScript code
Node-RED nodes are loaded by the runtime, not imported directly in scripts.
semaphore node configuration
Set capacity in node properties or via msg.capacity
No code import needed
Configuration is done via Node-RED UI, not via code.
Using semaphore in Node-RED function node
Access context or use flow control as designed
Trying to require('node-red-contrib-semaphore') in function node
Node-RED nodes cannot be imported; they are instantiated by the editor.

Install and use semaphore nodes to limit concurrent execution in Node-RED flows.

# Install in Node-RED directory cd ~/.node-red npm install node-red-contrib-semaphore # Restart Node-RED # Then in flow editor add 'semaphore take' node (configure name and capacity) # Connect to nodes that need limited concurrency # Add 'semaphore leave' node after processing to release
Debug
Known issues
gotchaDeadlock if leave node not called on error; use catch node to ensure leave is called
fix
Implement error handling with Catch node that triggers a semaphore leave
affects: all
gotchaSemaphore state is lost on Node-RED restart; semaphore capacity resets to default
fix
Design flows to be tolerant of restart or use persistent context
affects: all
gotchaMultiple take nodes can be connected to same semaphore by same name; they share capacity
fix
Ensure semaphore names are unique or intended to share
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'semaphore'
Missing semaphore dependency due to incomplete npm install
fix
Run 'npm install' in Node-RED directory or install globally with --save
semaphore leave not freeing slot
Leave node not triggered; perhaps due to error in flow
fix
Add error handling with Catch node to call leave on error
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
semaphorerequiredcore semaphore logic
Agent activity
2 hits · last 30 days
node
2
Resources
node-red-contrib-semaphore — npm install node-red-contrib-semaphore · libregistry