News for hackers. Stuff that matters.
Re:Why choose async/await over threads? by klooney on Monday March 25, 2024 @10:34AM (#39816846)
Async's perfect use case is proxies though- get a request, go through a small decision tree, dispatch the I/O to the kernel. You don't want proxies doing complex logic or computation, the stuff that creates bottlenecks in the cooperative multithreading.
Re:Why choose async/await over threads? by seabrookmx on Monday March 25, 2024 @12:15PM (#39818156)
Most API's (rest, graphql or otherwise) are effectively a proxy. Like you say, if you don't have complex logic and you're effectively mapping an HTTP request to a query, then your API code is just juggling incoming and outgoing responses and this evented/cooperative approach is very effective.