HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
sindresorhus
p-queue
TypeScript2019–2020
sindresorhus / p-queue

p-queue

Promise queue with concurrency control

3Distinct people
3Mentions
0Explicit recommenders
4.3KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Promise queue with concurrency control

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by week3 dated mentions

Observed mentions: 2019-09-25 10:57:20 UTC to 2020-04-02 17:55:36 UTC. Weeks start Monday, UTC.

0122019-09-23 00:00:00 UTC to 2019-09-30 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 commentsSep 232019-09-30 00:00:00 UTC to 2019-10-07 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-10-07 00:00:00 UTC to 2019-10-14 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-10-14 00:00:00 UTC to 2019-10-21 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-10-21 00:00:00 UTC to 2019-10-28 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-10-28 00:00:00 UTC to 2019-11-04 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-11-04 00:00:00 UTC to 2019-11-11 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-11-11 00:00:00 UTC to 2019-11-18 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-11-18 00:00:00 UTC to 2019-11-25 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-11-25 00:00:00 UTC to 2019-12-02 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-12-02 00:00:00 UTC to 2019-12-09 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-12-09 00:00:00 UTC to 2019-12-16 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-12-16 00:00:00 UTC to 2019-12-23 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-12-23 00:00:00 UTC to 2019-12-30 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsDec 232019-12-30 00:00:00 UTC to 2020-01-06 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-06 00:00:00 UTC to 2020-01-13 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-13 00:00:00 UTC to 2020-01-20 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-20 00:00:00 UTC to 2020-01-27 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-27 00:00:00 UTC to 2020-02-03 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-02-03 00:00:00 UTC to 2020-02-10 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-02-10 00:00:00 UTC to 2020-02-17 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-02-17 00:00:00 UTC to 2020-02-24 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-02-24 00:00:00 UTC to 2020-03-02 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-03-02 00:00:00 UTC to 2020-03-09 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-03-09 00:00:00 UTC to 2020-03-16 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-03-16 00:00:00 UTC to 2020-03-23 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-03-23 00:00:00 UTC to 2020-03-30 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-03-30 00:00:00 UTC to 2020-04-06 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 commentsMar 30

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Sep 232019-09-23 00:00:00 UTC2019-09-30 00:00:00 UTC202
Sep 302019-09-30 00:00:00 UTC2019-10-07 00:00:00 UTC000
Oct 72019-10-07 00:00:00 UTC2019-10-14 00:00:00 UTC000
Oct 142019-10-14 00:00:00 UTC2019-10-21 00:00:00 UTC000
Oct 212019-10-21 00:00:00 UTC2019-10-28 00:00:00 UTC000
Oct 282019-10-28 00:00:00 UTC2019-11-04 00:00:00 UTC000
Nov 42019-11-04 00:00:00 UTC2019-11-11 00:00:00 UTC000
Nov 112019-11-11 00:00:00 UTC2019-11-18 00:00:00 UTC000
Nov 182019-11-18 00:00:00 UTC2019-11-25 00:00:00 UTC000
Nov 252019-11-25 00:00:00 UTC2019-12-02 00:00:00 UTC000
Dec 22019-12-02 00:00:00 UTC2019-12-09 00:00:00 UTC000
Dec 92019-12-09 00:00:00 UTC2019-12-16 00:00:00 UTC000
Dec 162019-12-16 00:00:00 UTC2019-12-23 00:00:00 UTC000
Dec 232019-12-23 00:00:00 UTC2019-12-30 00:00:00 UTC000
Dec 302019-12-30 00:00:00 UTC2020-01-06 00:00:00 UTC000
Jan 62020-01-06 00:00:00 UTC2020-01-13 00:00:00 UTC000
Jan 132020-01-13 00:00:00 UTC2020-01-20 00:00:00 UTC000
Jan 202020-01-20 00:00:00 UTC2020-01-27 00:00:00 UTC000
Jan 272020-01-27 00:00:00 UTC2020-02-03 00:00:00 UTC000
Feb 32020-02-03 00:00:00 UTC2020-02-10 00:00:00 UTC000
Feb 102020-02-10 00:00:00 UTC2020-02-17 00:00:00 UTC000
Feb 172020-02-17 00:00:00 UTC2020-02-24 00:00:00 UTC000
Feb 242020-02-24 00:00:00 UTC2020-03-02 00:00:00 UTC000
Mar 22020-03-02 00:00:00 UTC2020-03-09 00:00:00 UTC000
Mar 92020-03-09 00:00:00 UTC2020-03-16 00:00:00 UTC000
Mar 162020-03-16 00:00:00 UTC2020-03-23 00:00:00 UTC000
Mar 232020-03-23 00:00:00 UTC2020-03-30 00:00:00 UTC000
Mar 302020-03-30 00:00:00 UTC2020-04-06 00:00:00 UTC110

What Hacker News says

3 sources
Yes, but he was giving the simplest implementation for the sake of brevity. Also, nobody said that we need callback error propagation in a priority queue to act the same exact way that callback error propagation works in a straight promise chain... but if you just want to reject all waiters in case of an error, you can do that. Take a look at sindresorhus' p-queue project - https://github.com/sindresorhus/p-queue - which is about 40 lines of code that take care of queueing exactly the way you want. And it's easy to modify if you want to reject the whole queue in case of an error, which is something that I've done myself in the past. You can see them discussing the possibility of that feature right here - https://github.com/sindresorhus/p-queue/issues/29 Long story short: Your problem is with ordering, not locking.
In V8 adds support for top-level await
While writing async code can indeed be challenging, I just disagree with the idea that JavaScript is lacking good "locking primitives": > All this async code without decent locking primitives is leading to a rabbit hole of race conditions... No, it's not. Here's a lock: let lock = Promise.resolve() // ... lock = lock.then(() => { /* critical section */ }) For the rare instances where more complex async flow control is required, there are a bunch of libraries for that (e.g. async[0], p-queue[1], etc.). [0] https://caolan.github.io/async/v3/docs.html [1] https://github.com/sindresorhus/p-queue
In V8 adds support for top-level await

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.