HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by never_inline | Hacker News Reader
Parent
Full thread
never_inline
·
Now lets say its an async cache instead of singleton.
View on HN
duped
·
Return the cached item if it exists else spawn a task to update it (doing nothing if the task has already been spawned), await the task and return the cached item.
never_inline
·
Thanks, that's a useful trick.
Reply on news.ycombinator.com