Hi, is it only me who would use a function to clea...
# arrow
d
Hi, is it only me who would use a function to clear the `memoize`d cache like https://clojure.github.io/core.memoize/#clojure.core.memoize/memo-clear! or should I go some simpler way and e.g. restart the application?
r
Hi David, there is currently no way to clear the memoized function cache in Arrow
are you saying we should add a way to clear it?
d
Thanks Raul. Yes, I think it would be helpful. But please note I need to clear all caches at once only (other use cases could be more complex) so I am now OK solving this on the infrastructure level by restarting the application.
r
if you don't mind me asking, what are you using function memoization for? it's intended to be used to cache pure functions that are computationally intensive but not really as an application level cache.
d
Of course I do not mind. In fact we are Kotlinizing a Java code that was using
Map
to provide an application level cache. So although it is not the best use case, I would say the result will be much cleaner on the source code level and not worse on the memory consumption level so to say. Or do you think there is a better solution for an application level cache? Would love to learn, thanks in advance!
While thinking this through it seems that you were right. We will at least try to keep some simplicity of
memoize
.