Hacker News new | ask | show | jobs
by utnick 3444 days ago
It could be, but if the service calls generally depend on the response from the previous service call. Or if you need to rate limit your calls to these services, I think its easier to code it not async
1 comments

For batches of transactions where each transaction has a service call that depends on the response from a previous service call, async especially outperforms.

Rate limiting is not hard either way, but single-threaded async is slightly easier because your counter is automatically thread safe.

The larger and more complex your system gets the harder it gets to keep it thread-safe. For me this is the big advantage of single-threaded async, and I like node because this single-threaded async is idiomatic in JavaScript.