forked from abouzarnouri/Auto-Refreshing-Cache
bezzad/Auto-Refreshing-Cache
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
AutoRefreshingCache is a MemoryCache which tries to refresh its hot entries before their actual expiration time is reached. This class gives you a single public method (i.e. GET). Here comes the pseudocode. get(param) result = cache.get(param) if (result == null) refresh(param) return cache.get(param) if (result needs to be refreshed) if (try_lock(result)) run refresh(param) in a new thread return result refresh(param) data = calc(param) cache.add(key:param, value:data, expiration:exp_time)
About
A MemoryCache which tries to prevent cache miss for hot entries, by refreshing before expiration.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- C# 100.0%