Hacker News new | ask | show | jobs
by robertlagrant 1091 days ago
Surely anything over a network is async? Unless you block on every call, which REST doesn't stop you doing.
1 comments

> Surely anything over a network is async?

Yes, but not everything should be. Synchronous RPC works better than async RPC with fewer failure points simply because there's only single line that is the point of call. Async RPC quickly devolves into a hairy mess.

> Unless you block on every call, which REST doesn't stop you doing.

But the current standards do. If you want `fetch()` to be synchronous, you have to wrap it and fake it.

If you want fetch to be synchronous, why not just write await in front of it?

RPC is the same, except you can't opt for async when you want it.