Skip to content

DimaProskurin/cache2q

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cache2q

Two queue (2Q) cache implementation in Python

Original paper: https://www.vldb.org/conf/1994/P439.PDF

CI MIT licensed pypi

Installation

pip install cache2q

Usage

from cache2q import Cache2Q

cache = Cache2Q(512)

# set value by key
cache.set("hello", "world")

# get value by key
cache.get("hello")  # "world"

# if key not exists
cache.get("key")  # None

# remove key
cache.remove("hello")
cache.get("hello")  # None

# clear cache
cache.clear()

About

Two queue (2Q) cache implementation in Python

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages