redis based cache_clear() for lru_cache
Project description
lru_cache_pubsub_cache_clear
lru_cache_pubsub_cache_clear
is a decorator to broadcast cache_clear()
calls to lru_cache
across
multiple instances of an application. This allows for local cache access speed. Example:
from lru_cache_pubsub_cache_clear import lru_cache_pubsub_cache_clear
from django_redis import get_redis_connection
@lru_cache_pubsub_cache_clear(redis_connection=get_redis_connection(),
channel_name='CHANNEL_CACHE_CLEAR',
sleep_time=3)
@lru_cache
def cache_data(key, value)
...
Then every time one of app instances calls cache_data.cache_clear()
it will be executed on all connected instances.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for lru-cache-pubsub-cache-clear-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ce4204c48f0df5689715b341d2c87370b6d5bf065f6db9786f882a60ccbb677 |
|
MD5 | 6b8add8af17332b546043dbecdf6a3d8 |
|
BLAKE2b-256 | 9eb6ddeacbfaee9830816a86e6bf9c5ae4f4fa5307d8b6b9a512f836ebdf0f77 |
Close
Hashes for lru_cache_pubsub_cache_clear-0.0.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c17fef21adfdbfb4eb182062fc493b44aab710aa9fed321df51b5344c0bf5df |
|
MD5 | 31c1fc80a0fd54607c853b163aff98ed |
|
BLAKE2b-256 | 768f81cd32afbc4e874a0160c6f8faad3829bdc81d6aa6ea8b5ea49898db53f0 |