TLDR Web Dev · ARTICLES & TUTORIALS

THE AWAIT EVENT HORIZON IN JAVASCRIPT

frontside.com8 min read

Summary from the TLDR Web Dev newsletter

An async function, upon awaiting a Promise, cannot proceed until that Promise resolves, which could potentially lead to resource leaks if the Promise never settles. There are many remediations to the problem, like Explicit Resource Management and AbortSignal. However, in practice, they are limited and don't solve the fundamental problem. Instead, generator functions in JavaScript can offer more structured concurrency as they are not constrained by the await event horizon.