TLDR Web Dev · ARTICLES & TUTORIALS

PRACTICAL GUIDE TO NOT BLOCKING THE EVENT LOOP

bbss.dev4 min read

Summary from the TLDR Web Dev newsletter

JavaScript runs on a single thread, so it’s essential to make sure long running functions don’t block the main event thread. Besides making the function asynchronous, there are two other strategies to consider: horizontal scaling and off-loading to a separate thread. This article explains these three strategies with graphs of the event loop and code examples.