3 ms·
> It's like every programming language and framework today suddenly decides to introduce those async primitives and I've yet to find a single use-case for it in
by jchw 7y ago
> It's like every programming language and framework today suddenly decides to introduce those async primitives and I've yet to find a single use-case for it in my projects.
Consider that maybe this is because your projects are not the intended targets of async programming.
Async is super not new. Fibers and CSP and etc. are not new. A lot of the benefit of better concurrency is exactly for stuff that scales horizontally, but just because you can scale to hundreds of boxes does not mean you want each box to be bottlenecked on how many connections it can handle. For servers you absolutely want to be able to use your nodes to their fullest. Demand for this is almost certainly driving programming languages.
10 boxes handling 10000 connections > 100 boxes handling 1000 connections (edit: each)
- vbezhenar 7y agoYou can use async network calls to handle multiple number of connections (in library code) yet use thread pool to write business logic (application code). I'm not suggesting to just use blocking I/O API. Non-blocking API like select/epoll/etc is very useful and should be utilized whenever possible. I'm about those language features.
- jchw 7y agoWhy is this approach nicer than event loops w/ async/await or goroutines? I think forcing humans to manually deal with continuations is not humane :)
- rowanG077 7y agoWhy do you want to make your code more complex by using select/epoll/etc and making continuation spaghetti instead of just embracing async?
- Scarbutt 7y ago100 boxes handling 1000 connections I hope this is a typo ;)
- gdxhyrd 7y agoYou are mixing up asynchronous IO with non-blocking IO with async syntax sugar. As the name implies, async syntax sugar is a convenience, it does not magically improve performance.