Replies: 2 comments 2 replies
-
Caching is a huge topic so hard to say give a "one true way" to do it. Among other things it depends on
But if all you want is the simplest possible thing, and the operation to cache doesn't do IO, then what you posted is a very common way of doing it. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Thank you @davidpdrsn for the response. It is everything that I need to know. I've changed the title to include "very simple" so that it may be more useful to others. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to implement shared state (to cache expensive functions in this instance) as an Arc wrapped Mutex. I assume others will find this useful too. Here is a minimal pseudo-code example for how I'm trying to do it. I'd be grateful if you could guide me on whether (1) this approach makes sense, and (2) if there is a more canonical way?
Beta Was this translation helpful? Give feedback.
All reactions