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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Designing APIs for Asynchrony

24 点作者 iambot超过 11 年前

1 comment

gruseom超过 11 年前
I have code that calls back synchronously if a value is in memory and asynchronously if it has to make a network call to get it. It&#x27;s simple, and I&#x27;m not persuaded by this post (or the one it recommends) to make it more complicated. In this particular use case it seems enough to know that the callback <i>may</i> occur asynchronously, so you can&#x27;t assume that anything will still be in scope.
评论 #6269873 未加载
评论 #6270322 未加载
评论 #6269965 未加载