-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Description
Scenario:
- You run two tasks - minify-css, minify-js
- minify-js is processing a file and blocks the event loop since the underlying module (let's say uglify) is full of nested loops that take forever
- minify-css is stalled because the main event loop is blocked
- minify-js finishes the file
- minify-css starts processing its file asynchronously like it's supposed to
- minify-js gets another file and blocks the event loop again, thus stalling minify-css until it's done
- minify-js finished before minify-css ever gets through the first file
- minify-css shows up as taking way longer than it should have
tl;dr shitty 3rd party modules that run synchronously (like uglify) will block the main loop preventing other things from running