Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
never_inline
· 1y ago · 0 comments
Now lets say its an async cache instead of singleton.
Comments
[–]
duped
1y ago
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
OP
1y ago
Thanks, that's a useful trick.