【文件属性】:
文件名称:easy_cache:用于单线程环境的简单内存键值缓存
文件大小:6KB
文件格式:ZIP
更新时间:2021-07-02 08:56:24
python key-value cache easy Python
用于单线程环境的简单内存键值缓存
版本:
掌握
安装
python setup.py install
支持的更换政策
LRU(最近最少使用)
MRU(最近使用)
RR(随机替换)
LFU(最不常用)
使用示例
from easy_cache . cache import EasyCache , Algorithm
c = EasyCache ( capacity = 10 , algorith = Algorithm . LRU )
c . set ( 'a_key' , 'a_value' , timeout = 3 * 60 )
c . get ( 'a_key' ) # got 'a_value'
c . get ( 'a_key' ) # got 'a_value'
c . get ( 'a_key' ) # got None after 3*60 seconds
c
【文件预览】:
easy_cache-master
----setup.py(364B)
----.gitignore(675B)
----.travis.yml(64B)
----LICENSE(1KB)
----README.md(1KB)
----tests()
--------__init__.py(0B)
--------test_cache.py(5KB)
----easy_cache()
--------__init__.py(0B)
--------cache.py(5KB)