JuliaCollections / Memoize.jl

@memoize macro for Julia
Other
177 stars 22 forks source link

Define a Maximum Cache Size + Policies (LRU, TTL, etc) #20

Closed dmoliveira closed 7 years ago

dmoliveira commented 7 years ago

Limit the cache size.

simonster commented 7 years ago

Memoize.jl currently supports specifying the type of associative to use for memoization, so you can just pass in an associative that implements these caching strategies (e.g. https://github.com/JuliaLang/julia/blob/master/examples/lru.jl). To allow specifying size, it might be useful to support specifying an instance of the associative instead of the type.

dmoliveira commented 7 years ago

Hi @simonster. Ok, that is great :) It was not clear that we could extend the original cache with strategies like that. We could improve the documentation putting some nice examples. If I have time I'll try to do a PR for this. I'll close this issue now.