金字塔的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的html并排表   如何修复Java(安卓)中的“找不到自由端口”错误   java为什么在以下代码中实现接口“onmapreadycallback”时出错?   java在Spring批处理中重置InMemory数据库   java非阻塞网络编程超时问题   安卓 Java:从UTF8字符串创建可绘制   java显示文本文件中包含的路径中的图像   gzipinputstream Java。伊奥。IOException:不是GZIP格式   java线程调度程序如何执行此代码?   java通过setFragmentResult将信息发送到另一个片段   java从任何地方进入活动   java如何使用SNMP4j开发用于搜索OID值的类   Java中的递归字符串索引超出范围错误(字符串索引超出范围异常)   缓存如何清除Java缓存中的特定文件?   java将构建任务添加到maven pom项目   java FileOutputStream非常慢   如果定义了父pom,则不会发生存储库url的java Maven属性替换