Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CarCache

Elixir CI Module Version Hex Docs Total Download License Last Updated

CLOCK with adaptive replacement (CAR) cache, based on the following paper:

CAR: Clock with Adaptive Replacement

CAR is a self tuning cache that strives to find a balance between frequently accessed items and recently accessed items.

CAR is fairly similar to ARC Adaptive Replacement Cache for which there is a good introductory explanation here: Adaptive Replacement Cache

Usage

The cache must be given a name and a max_size when started.

{:ok, _pid} = CarCache.start_link(name: :my_cache, max_size: 1_000)

After the process has started you can use it based on it's name:

> CarCache.get(:my_cache, :foo)
nil

> CarCache.insert(:my_cache, :foo, :bar)
:ok

> CarCache.get(:my_cache, :foo)
:bar

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages