Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-red-contrib-simple-queue

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-simple-queue - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

2

package.json

@@ -8,3 +8,3 @@ {

},
"version": "1.0.2",
"version": "1.1.0",
"license": "MIT",

@@ -11,0 +11,0 @@ "keywords": [

@@ -7,4 +7,15 @@ const {v4: uuidv4} = require('uuid');

this.count = config.count||4;
this.unique_check = config.unique_check||undefined;
this.waiting = [];
this.queue = [];
this.unique_index = {};
RED.events.on('runtime-event', (e) => {
if(e.id==='project-update') {
console.log(e);
console.log(RED.settings.userDir);
}
});
let node = this;

@@ -38,2 +49,6 @@

node.queue.splice(idx, 1);
// If we have unique check enabled remove it from the list
if(node.unique_check) {
delete node.unique_index[msg.queue_msg_id];
}
dequeueMessages();

@@ -48,2 +63,13 @@ } else {

if(node.unique_check) {
// Make sure its not in our unique list
const key = m[node.unique_check];
if(!key || Object.values(node.unique_index).indexOf(key) === -1) {
node.unique_index[m.queue_msg_id] = key;
} else {
// Key is already in the queue or under processing, skip it
return;
}
}
if(node.queue.length < config.count) {

@@ -50,0 +76,0 @@ // Still place in queue

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc