@xtia/async-queue
Advanced tools
+4
-1
@@ -38,5 +38,8 @@ "use strict"; | ||
| const result = new Promise(task.func); | ||
| result.then(value => task.resolve(value), value => task.reject(value)).finally(() => setTimeout(() => { | ||
| result.then(value => task.resolve(value), value => task.reject(value)).finally(this.delayMs == 0 ? () => { | ||
| this.busyTasks--; | ||
| this.continue(); | ||
| } : () => setTimeout(() => { | ||
| this.busyTasks--; | ||
| this.continue(); | ||
| }, this.delayMs)); | ||
@@ -43,0 +46,0 @@ } |
+5
-1
| { | ||
| "name": "@xtia/async-queue", | ||
| "version": "0.0.1", | ||
| "version": "0.0.2", | ||
| "repository": { | ||
@@ -10,2 +10,6 @@ "url": "https://github.com/tiadrop/async-queue", | ||
| "main": "src/index.js", | ||
| "scripts": { | ||
| "prepublishOnly": "cp ../README.md .", | ||
| "postpublish": "rm README.md" | ||
| }, | ||
| "keywords": [ | ||
@@ -12,0 +16,0 @@ "async", |
+5
-0
@@ -67,2 +67,7 @@ # async-queue | ||
| ); | ||
| // wrap builtins, fixed priority | ||
| const enqueueFetch = queue.createFunc(fetch, 2); | ||
| const urgentFetch = queue.createFunc(fetch, 1); | ||
| // all type information is inherited from from fetch | ||
| ``` | ||
@@ -69,0 +74,0 @@ |
6739
6.18%83
3.75%88
6.02%