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.

Show HN: Async/await alternative

17 pointsby bruno2223over 8 years ago

6 comments

vsviridovover 8 years ago
Node 7 is out with async/await behind the flag.
zamalekover 8 years ago
<p><pre><code> &#x2F;&#x2F; the stream has now been fully read, async in the background </code></pre> What if the file is gigabytes in size?
评论 #12837917 未加载
skybrianover 8 years ago
It&#x27;s a nice trick but it&#x27;s unsafe in general. JavaScript libraries usually assume single-threaded event handling. If you start up another event loop from a callback (while some other library&#x27;s code is already on the stack), you&#x27;ll probably break it.
maxpertover 8 years ago
Well I hope NodeJS ultimately settles on such a syntax to preempt and resume automatically. I love Golang in this regard since it abstracts out everything using channels, and go-routines (not to compare multiple thread support).
aaronhoffmanover 8 years ago
Love the simplicity. Wish it was powered by RxJS <a href="https:&#x2F;&#x2F;github.com&#x2F;Reactive-Extensions&#x2F;RxJS" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Reactive-Extensions&#x2F;RxJS</a>
bbcbasicover 8 years ago
Looked at the deasync that this is based on, and it looks like they are trying to reinvent threads? Seems ironic to me.
评论 #12836078 未加载