🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

epii-blocking-queue

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

epii-blocking-queue - npm Package Compare versions

Comparing version
1.1.0
to
1.1.1
+2
-0
dist/index.d.ts

@@ -14,2 +14,3 @@ export type TaskItem = {

lockFinishNum: number;
_clearAlllock: boolean;
constructor(interval?: number);

@@ -23,3 +24,4 @@ push(fun: Function): Promise<any>;

unlock(): void;
clearAllWaitLock(): void;
}
export declare function getBlockingQueue(name?: string): BlockingQueue;
+7
-2

@@ -24,2 +24,3 @@ "use strict";

this.lockFinishNum = 0;
this._clearAlllock = false;
(() => __awaiter(this, void 0, void 0, function* () {

@@ -78,2 +79,3 @@ while (true) {

return __awaiter(this, void 0, void 0, function* () {
this._clearAlllock = false;
this.lockWaitNum++;

@@ -86,5 +88,5 @@ let _forNum = this.lockWaitNum;

}
if (!this.enable) {
if (this._clearAlllock) {
this.unlock();
throw new Error("thread is stoped");
throw new Error("thread is clear");
}

@@ -99,2 +101,5 @@ yield sleep(100);

}
clearAllWaitLock() {
this._clearAlllock = true;
}
}

@@ -101,0 +106,0 @@ exports.BlockingQueue = BlockingQueue;

{
"name": "epii-blocking-queue",
"version": "1.1.0",
"version": "1.1.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",