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.

Designing APIs for Asynchrony

24 pointsby iambotover 11 years ago

1 comment

gruseomover 11 years ago
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 未加载