TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Do NOT stop worrying about blocking in async functions

2 pointsby cjgalmost 5 years ago

1 comment

lmilcinalmost 5 years ago
I personally see no reason to bother writing async code if your intention is to block there.<p>Problems start when many people work on the project, some of them wanted to use async and some of them don&#x27;t have knowledge&#x2F;experience to correctly compose async code.<p>Composing async code requires a different way of thinking about the flow of operations and I found it impossible to understand for many developers who are barely understanding the regular flow of what is happening.<p>I am undecided on whether allow blocking code in async. On one side I think disallowing blocking in async is the correct way, on the other hand I am a little bit scared by millions of developers who don&#x27;t know what they are doing, don&#x27;t know how to compose async code and will inevitable be putting bits and pieces of blocking code somewhere deep inside async flow.<p>My current project uses Reactor and RxJava. Some people do understand what this entails but large portion of developers use the pattern where they put a simple Rx flow and in the same function block waiting for the result instead of returning reactive component for composition.