3 ms·
I don't think "async-first" is really all it's cracked up to be. It's great for concurrent I/O (webservers). Not great for writing run-of-the-mill sysadmin sc
by VWWHFSfQ 5y ago
I don't think "async-first" is really all it's cracked up to be. It's great for concurrent I/O (webservers). Not great for writing run-of-the-mill sysadmin scripts like rotating log files, doing file backups, etc. Now instead of just knowing that your cron job is doing something one at a time, suddenly you have all these async things happening and you look at your process table and there's 40 node.js processes trying to compress every log file in the system all at once.
And if you don't want it to do that then you have to start managing the concurrency yourself. I've never had to manage concurrency in a shell script beyond just making sure my crons don't run over each other if they take too long.
- nwienert 5y agoYou’re conflating concurrency and parallelism. Unless you’re explicitly forking the process, the async all happens in one process. Async is incredibly easy to manage in node, even the simplest linter handles telling you you’re forgetting to await if you are.
- colordrops 5y agoYou can do it all synchronously in node if you wish. The async gives another dimension to work with.