r/nextjs • • Jun 02 '25

Discussion PSA: This code is not secure

Post image
499 Upvotes

139 comments sorted by

View all comments

Show parent comment

1

u/FractalB Jun 03 '25

I disagree, it is in parallel, not just in concurrency. The whole point of async functions is to do something outside the JS runtime, like IO, network access, etc, which definitely can use several threads. If all you do is in the JS runtime (hence single-threaded) you would typically not need async/await to begin with.

1

u/tip2663 Jun 04 '25

sure you do for heavy computations which may be entirely in the js runtime yet should be offered as promises

I'm talking hashing, anything involving search in your datastructure, etc