TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Async/await alternative

17 点作者 bruno2223超过 8 年前

6 条评论

vsviridov超过 8 年前
Node 7 is out with async/await behind the flag.
zamalek超过 8 年前
<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 未加载
skybrian超过 8 年前
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.
maxpert超过 8 年前
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).
aaronhoffman超过 8 年前
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>
bbcbasic超过 8 年前
Looked at the deasync that this is based on, and it looks like they are trying to reinvent threads? Seems ironic to me.
评论 #12836078 未加载