hgzimmerman / rocket-file-cache

An in-memory file cache for the Rocket web framework
MIT License
22 stars 6 forks source link

Provide a more explicit aging-out function. #21

Closed hgzimmerman closed 6 years ago

hgzimmerman commented 6 years ago

Allow consumers of the crate to specify in the CacheBuilder a function that will execute every n accesses for the whole cache that will alter every file's access count and therefore priority.

Make the n an AtomicUsize. Given the ConcurrentHashmap implementation, it should be possible to iterate through all entries without depriving

hgzimmerman commented 6 years ago

I am going to delay working on this feature until after 1.0.0 is released.

This feature would require some minor architectural changes I'm not willing to undertake currently.

If anyone is interested in this feature, please reopen an issue and I will attempt to address it.