elastic / go-freelru

Apache License 2.0
167 stars 12 forks source link

There is way to cleanly evict all elements #43

Closed esp32wrangler closed 1 month ago

esp32wrangler commented 2 months ago

I would like to cleanly drop the complete cache and call the evict callback on all elements. This is not currently possible, because:

Please add an option to Purge to call the eviction callback, or add a new function such as EvictAll

rockdaboot commented 2 months ago

Thanks for the request, sounds reasonable. I'll have a closer look at it soon.

rockdaboot commented 1 month ago

@esp32wrangler Please let me know if #49 satisfies your needs

esp32wrangler commented 1 month ago

@esp32wrangler Please let me know if #49 satisfies your needs

Thanks for the quick fix! It looks good, please merge and tag it so I can properly test it in my app.