+7
-4
@@ -204,3 +204,3 @@ import { EventEmitter } from 'eventemitter3'; | ||
| /** | ||
| The tasks currently being executed. Each task includes its `id`, `priority`, `startTime`, and `timeout` (if set). | ||
| The tasks currently being executed. Each task includes its `id`, `priority`, `startTime`, `timeout` (if set), and `timeoutRemaining` (milliseconds until the task times out, or `undefined` if no timeout is set). | ||
@@ -212,3 +212,3 @@ Returns an array of task info objects. | ||
| const queue = new PQueue({concurrency: 2}); | ||
| const queue = new PQueue({concurrency: 2, timeout: 10000}); | ||
@@ -225,3 +225,4 @@ // Add tasks with IDs for better debugging | ||
| // startTime: 1759253001716, | ||
| // timeout: undefined | ||
| // timeout: 10000, | ||
| // timeoutRemaining: 9700 | ||
| // }, { | ||
@@ -231,3 +232,4 @@ // id: 'posts-456', | ||
| // startTime: 1759253001916, | ||
| // timeout: undefined | ||
| // timeout: 10000, | ||
| // timeoutRemaining: 9900 | ||
| // }] | ||
@@ -241,2 +243,3 @@ ``` | ||
| readonly timeout?: number; | ||
| readonly timeoutRemaining?: number; | ||
| }>; | ||
@@ -243,0 +246,0 @@ } |
+10
-5
@@ -739,3 +739,3 @@ import { EventEmitter } from 'eventemitter3'; | ||
| /** | ||
| The tasks currently being executed. Each task includes its `id`, `priority`, `startTime`, and `timeout` (if set). | ||
| The tasks currently being executed. Each task includes its `id`, `priority`, `startTime`, `timeout` (if set), and `timeoutRemaining` (milliseconds until the task times out, or `undefined` if no timeout is set). | ||
@@ -747,3 +747,3 @@ Returns an array of task info objects. | ||
| const queue = new PQueue({concurrency: 2}); | ||
| const queue = new PQueue({concurrency: 2, timeout: 10000}); | ||
@@ -760,3 +760,4 @@ // Add tasks with IDs for better debugging | ||
| // startTime: 1759253001716, | ||
| // timeout: undefined | ||
| // timeout: 10000, | ||
| // timeoutRemaining: 9700 | ||
| // }, { | ||
@@ -766,3 +767,4 @@ // id: 'posts-456', | ||
| // startTime: 1759253001916, | ||
| // timeout: undefined | ||
| // timeout: 10000, | ||
| // timeoutRemaining: 9900 | ||
| // }] | ||
@@ -773,3 +775,6 @@ ``` | ||
| // Return fresh array with fresh objects to prevent mutations | ||
| return [...this.#runningTasks.values()].map(task => ({ ...task })); | ||
| return [...this.#runningTasks.values()].map(task => ({ | ||
| ...task, | ||
| timeoutRemaining: task.timeout ? Math.max(0, task.startTime + task.timeout - Date.now()) : undefined, | ||
| })); | ||
| } | ||
@@ -776,0 +781,0 @@ } |
@@ -35,3 +35,3 @@ import { type Queue, type RunFunction } from './queue.js'; | ||
| /** | ||
| Whether queue tasks within concurrency limit, are auto-executed as soon as they're added. | ||
| Whether queue tasks within the concurrency limit are auto-executed as soon as they're added. | ||
@@ -38,0 +38,0 @@ @default true |
+1
-1
| { | ||
| "name": "p-queue", | ||
| "version": "9.2.0", | ||
| "version": "9.3.0", | ||
| "description": "Promise queue with concurrency control", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
+7
-5
@@ -112,3 +112,3 @@ # p-queue | ||
| Whether queue tasks within concurrency limit, are auto-executed as soon as they're added. | ||
| Whether queue tasks within the concurrency limit are auto-executed as soon as they're added. | ||
@@ -480,3 +480,3 @@ ##### queueClass | ||
| The tasks currently being executed. Each task includes its `id`, `priority`, `startTime`, and `timeout` (if set). | ||
| The tasks currently being executed. Each task includes its `id`, `priority`, `startTime`, `timeout` (if set), and `timeoutRemaining` (milliseconds until the task times out, or `undefined` if no timeout is set). | ||
@@ -488,3 +488,3 @@ Returns an array of task info objects. | ||
| const queue = new PQueue({concurrency: 2}); | ||
| const queue = new PQueue({concurrency: 2, timeout: 10000}); | ||
@@ -503,3 +503,4 @@ // Add tasks with IDs for better debugging | ||
| startTime: 1759253001716, | ||
| timeout: undefined | ||
| timeout: 10000, | ||
| timeoutRemaining: 9700 | ||
| }, | ||
@@ -510,3 +511,4 @@ { | ||
| startTime: 1759253001916, | ||
| timeout: undefined | ||
| timeout: 10000, | ||
| timeoutRemaining: 9900 | ||
| } | ||
@@ -513,0 +515,0 @@ ] |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
83189
0.83%1229
0.66%1080
0.19%