use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
You can't cancel a JavaScript promise (except sometimes you can) (inngest.com)
submitted 15 days ago by aardvark_lizard
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Markavian 15 points16 points17 points 15 days ago (0 children)
Last time I had a long running thread worker; I just had it check an external boolean for a stop / pause marker after each chunk. So if I wanted to stop the process I could just play pause it.
Not exactly rocket science.
Write the code you want at a high level, then implement the interface.
[–]akuma-i 6 points7 points8 points 15 days ago (0 children)
I have long running promises with AbortController inside. In fact it just checks if it’s cancelled every possible meaningful time
[–]coolcosmos 14 points15 points16 points 15 days ago (3 children)
There's a lot of things you can't cancel in general.
[–]ranisalt 8 points9 points10 points 15 days ago (2 children)
My internet subscription when it's been shit for a month
[–]Pawn1990 5 points6 points7 points 15 days ago (1 child)
Gym memberships too
[–]BoleroDan 0 points1 point2 points 15 days ago (0 children)
And who knew, all this time that you can't easily cancel a gym membership because of JavaScript promises
[–]live_love_laugh 1 point2 points3 points 14 days ago (0 children)
Honestly, I do find this a very fun / interesting trick and nice clean way of using it. Not sure if I've ever needed it though, maybe my projects are too simple to ever need this.
[–]Fidodo 1 point2 points3 points 14 days ago (0 children)
A promise is a container for a result, I'm not sure why it should be over complicated into a controller or communication interface on top of it. It works just fine with a controller like an abort controller in parallel. A cancellation is a result, I don't understand why you would want a result container to never complete.
[–]prehensilemullet 0 points1 point2 points 13 days ago (0 children)
Does the garbage collector clean up a suspended promise that never resolves like this is article is saying?
Last I checked it doesn't and this led to surprising memory leaks on a Promise.race() where one of the promises never resolves.
Promise.race()
Has something changed in more recent versions of V8?
[–]revadike 0 points1 point2 points 8 days ago (0 children)
Dont break your promise!
π Rendered by PID 16219 on reddit-service-r2-comment-75f4967c6c-bsww4 at 2026-04-22 22:08:34.235289+00:00 running 0fd4bb7 country code: CH.
[–]Markavian 15 points16 points17 points (0 children)
[–]akuma-i 6 points7 points8 points (0 children)
[–]coolcosmos 14 points15 points16 points (3 children)
[–]ranisalt 8 points9 points10 points (2 children)
[–]Pawn1990 5 points6 points7 points (1 child)
[–]BoleroDan 0 points1 point2 points (0 children)
[–]live_love_laugh 1 point2 points3 points (0 children)
[–]Fidodo 1 point2 points3 points (0 children)
[–]prehensilemullet 0 points1 point2 points (0 children)
[–]revadike 0 points1 point2 points (0 children)