Socket
Socket
Sign inDemoInstall

promise-blocking-queue

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1 to 0.0.2

4

CHANGELOG.md

@@ -8,4 +8,8 @@ # Changelog

## v0.0.2
Use new version of linked-list
## v0.0.1
First version!

21

dist/BlockingQueue.js
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const events_1 = require("events");
const LinkedList = require("linked-list");
const linked_list_1 = require("linked-list");
class Node extends linked_list_1.Item {
constructor(item) {
super();
this.item = item;
}
}
class BlockingQueue extends events_1.EventEmitter {
constructor(options) {
super();
this._queue = [];
this._queue = new LinkedList();
this._activeCount = 0;

@@ -29,3 +37,3 @@ options = options || {};

else {
this._queue.push(item);
this._queue.append(new Node(item));
}

@@ -41,9 +49,10 @@ return {

get pendingCount() {
return this._queue.length;
return this._queue.size;
}
_next() {
this._activeCount--;
const item = this._queue.shift();
if (item) {
this._run(item);
const node = this._queue.head;
if (node) {
node.detach();
this._run(node.item);
}

@@ -50,0 +59,0 @@ else {

{
"name": "promise-blocking-queue",
"version": "0.0.1",
"version": "0.0.2",
"description": "Memory optimized promise blocking queue with concurrency control",

@@ -74,3 +74,6 @@ "main": "dist/index.js",

"typescript": "^3.5.3"
},
"dependencies": {
"linked-list": "^2.1.0"
}
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc