New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getOrCreate() method #102
Comments
Not implementing a .getOrCreate method could even be a possible issue ( and as demonstrated with your implementation )! The timing between the If your interested, I've got sample code to prove the problem. |
I'd accept a I'm not worried about the time resolution of TTL expiring, this is primarily a lru cache anyway. |
Proof of concept if anyone wants to pick this up and write tests for it: https://github.com/isaacs/node-lru-cache/blob/isaacs/get-or-fetch-return-stale-while-fetching/index.js |
This seems like a very common use case, and in fact it's the preferred way you use a cache in Rails. Is there any reason it's not implemented?
Where:
The text was updated successfully, but these errors were encountered: