Skip to main content

zencache

Pure memory cache powered by orpc.

Install

pip install zencache

Example server config: zencached-config.yml

daemon: true
pidfile: zencached.pid
loglevel: INFO
logfile: zencached.log
server:
  listen: 0.0.0.0
  port: 6779
  backlog: 8192
  buffer_size: 65536
  rfile_buffer_size: 65536
  wfile_buffer_size: 65536
  max_request_size: 4194304
authentication:
  enable: true
  users:
    app01: spnPF3HzY975GJYC
    app02: ZWRVfHrK8QkQoOnQ
    app03: xuFTlTy9i6KCfncp
zencache:
  ttl-scanner-worker-interval: 60
  ttl-scanner-manager-interval: 60

expire options

  • NONE: Default option, always set expiry.
  • NX: Set expiry only when the key has no expiry.
  • XX: Set expiry only when the key has an existing expiry.
  • GT: Set expiry only when the new expiry is greater than current one.
  • LT: Set expiry only when the new expiry is less than current one.

Example client usage

from orpc_client import OrpcConnectionPool

zencached_client_pool = OrpcConnectionPool(10, kwargs={
    "host": "127.0.0.1",
    "port": 6779,
    "username": "app01",
    "password": "spnPF3HzY975GJYC",
    "login_event": "zencache.login",
    "auto_login": True,
    })

with zencached_client_pool.get_session() as session:
    session.zencache.set('a', 'a')
    assert session.zencache.get('a') == 'a'

Releases

v0.1.4

  • Force to upgrade orpc version.
  • Doc update.

v0.1.3

  • Add gevent patch all.
  • Force item key to str format.

v0.1.0

  • First release.

Release files for zencache 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zencache 0.1.4
File Size Uploaded
zencache-0.1.4.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zencache 0.1.4
File Interpreter ABI Platform
zencache-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 12.6 kB

Release files / zencache-0.1.4.tar.gz

Download URL zencache-0.1.4.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8d738c5ffa2a9ef7385968a512a24745b7ed6885c6450e87a66b8965cb1213d5
BLAKE2b-256 checksum
How to use checksums
7885852be803697dc70a63ff4647c5233a12621173da76e5d7f2d4f7f9079abb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release files / zencache-0.1.4-py3-none-any.whl

Download URL zencache-0.1.4-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3132352cccfd9faaa686e68d05ba03ab3b9860cbea382b7d35141599355973a5
BLAKE2b-256 checksum
How to use checksums
26d2c9667ca5e4aa726141df6f0a65db3361f38d690f8952130c8801dcde653f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page