Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement β†’
Sign In

p-queue

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

p-queue - npm Package Compare versions

Comparing version
9.2.0
to
9.3.0
+7
-4
dist/index.d.ts

@@ -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 @@ }

@@ -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

{
"name": "p-queue",
"version": "9.2.0",
"version": "9.3.0",
"description": "Promise queue with concurrency control",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -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 @@ ]