Python 两级缓存框架 Py3Cache

码农软件 · 软件分类 · 缓存系统 · 2019-08-29 18:41:35

软件介绍

Py3Cache 是 J2Cache 两级缓存框架的 Python 语言移植版本。关于两级缓存框架的思路已经要解决的问题请看 J2Cache 项目首页中的文章以及视频,这里不再赘述。

Py3Cache 使用 Redis 的 Pub/Sub 进行缓存事件分发。目前的功能还是缺失的,主要是 Beaker 这个一级缓存中的对象在过期失效时候没有通知其他的节点。

环境要求

  • Python 3

  • Beaker (一级缓存)

  • PyRedis (二级缓存)

  • Pickle (序列化器)

  • Redis (服务)

使用方法

  1. 安装 Redis 服务并启动

  2. 修改 config.ini 中关于 Redis 服务的主机和端口的配置

  3. 在 config.ini 的 [beaker] 定义一级缓存,具体请看 config.ini 的示例配置(可选)

  4. 启动多个测试应用 : python3 Py3Cache.py

测试方法

启动测试应用后可以使用如下命令进行缓存的操作

exit/quit 退出测试应用
get [region] [key] 读取 [region] 中的 [key] 缓存数据
set [region] [key] [val] 设置 [region] 中的 [key] 值为 [val]
evict [region] [key] 清除某个缓存数据
clear [region] 清除整段缓存数据

本文地址:https://www.codercto.com/soft/d/13447.html

Beginning ASP.NET 4 in C# and Vb

Beginning ASP.NET 4 in C# and Vb

Imar Spaanjaars / Wrox / 2010-3-19 / GBP 29.99

This book is for anyone who wants to learn how to build rich and interactive web sites that run on the Microsoft platform. With the knowledge you gain from this book, you create a great foundation to ......一起来看看 《Beginning ASP.NET 4 in C# and Vb》 这本书的介绍吧!

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具