Skip to content

bingtaoli/python-lru-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

python-lru-cache

This repo is inspired by https://github.com/openresty/lua-resty-lrucache

Synopsis

create an cache with capacity of 10

lru_cache = LRUCache(10)
lru_cache.set('b', 20, 1)
print lru_cache.get('b')
time.sleep(2)  # expire
print lru_cache.get('b')

description

use a double linked list to store usage order. use a simple dict to store key=>value.

About

lru-cache implemented by python, inspired by lua-resty-lrucache

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages