Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Now lets say its an async cache instead of singleton.


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.


Thanks, that's a useful trick.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: