Skip to main content

Pure memory cache powered by Open RPC.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zencache-0.1.4.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

zencache-0.1.4-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file zencache-0.1.4.tar.gz.

File metadata

  • Download URL: zencache-0.1.4.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for zencache-0.1.4.tar.gz
Algorithm Hash digest
SHA256 8d738c5ffa2a9ef7385968a512a24745b7ed6885c6450e87a66b8965cb1213d5
MD5 52810fbeda3eb252a71df37d9b1c667f
BLAKE2b-256 7885852be803697dc70a63ff4647c5233a12621173da76e5d7f2d4f7f9079abb

See more details on using hashes here.

File details

Details for the file zencache-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: zencache-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for zencache-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3132352cccfd9faaa686e68d05ba03ab3b9860cbea382b7d35141599355973a5
MD5 0a6d9a2da6f712cd836b48304b501f16
BLAKE2b-256 26d2c9667ca5e4aa726141df6f0a65db3361f38d690f8952130c8801dcde653f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page