金字塔的dogpile.cache工厂

pyramid_dogpile_cache的Python项目详细描述


简介

pyramid_dogpile_cache是金字塔的一个小型dogpile缓存工厂。

设置

config.include('pyramid_dogpile_cache')放在启动代码中的某个位置:

config=Configurator(...)config.include('pyramid_dogpile_cache')

或者您也可以将pyramid_dogpile_cache添加到配置中的pyramid.includes列表:

pyramid.includes=pyramid_dogpile_cache

代码中的用法

pyramid_dogpile_cache.get_region是唯一的api。

frompyramid_dogpile_cacheimportget_regionregion=get_region('foo')# ... do whatever operation on the cache region ...

设置

dogpile_cache.regions

A list of region names to initialize through the factory. Regions can be separated by either spaces or commas.

dogpile_cache.backend

The default backend for cache regions. You can later override it with the region-specific setting.

dogpile_cache.expire

The default expiration time for cache regions. You can later override it with the region-specific setting.

dogpile_cache.arguments.*

The arguments for the default backend. You can later override it with the region-specific setting.

dogpile_cache.function_key_generator

Passed to ^{tt11}$.

dogpile_cache.key_mangler

Passed to ^{tt11}$.

dogpile_cache.async_creation_runner

Passed to ^{tt11}$.

dogpile_cache.REGION.*

Each set of region-specific settings is prefixed with the region name followed by the setting name. For example, settings for region ^{tt17}$ can be like the following:

; global settingsdogpile_cache.backend=file; settings for foodogpile_cache.foo.backend=redisdogpile_cache.foo.arguments.host=127.0.0.1dogpile_cache.foo.arguments.port=6379dogpile_cache.foo.arguments.db=0dogpile_cache.foo.arguments.redis_expiration_time=7200dogpile_cache.foo.arguments.distributed_lock=1

贡献者

  • 森吉小泉

更改日志

0.0.1

  • 首次发布

0.0.2

  • 小文档修复

0.0.3

  • 许可证包含(MIT)

0.0.4

  • 包装修复程序

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Oracle将休眠为ISO 8601日期格式   当有线程时,swing计时器不会停止。睡在Java里面   如何使用swing在java中清空密码字段值(字符串)   如何在编辑文本字段上设置单词java(安卓)   单独类中的java OkHttp请求   java Tomcat配置文件/上下文xml似乎已经崩溃了。请确保它是可分析和有效的。有关详细信息,请参阅服务器日志   java在科尔多瓦的ActivityResult上传递   java如何在映射中保持插入顺序。工厂?   “DataOutputStream”和“ObjectOutputStream”之间的java差异   java从FTP文件列表中获取项目的时间戳   java如何在spring security中为每个人忽略一些资源/URL?   模板类嵌套时新的Java泛型类构造函数问题   java读取并查找文件大小为1GB的行   java如何使用字符串say“stop”停止整数格式的while循环   java是否可以在应用程序启动之间将JVM保留在内存中?   java Springboot出现“出现意外错误(类型=内部服务器错误,状态=500)”的问题