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 get_data(key)
...
return value
Here sleep_time
is interval (in seconds) between pubsub message checks.
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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5adef005a796870ed9ce3750e10182b318956b52defaac34af4dc778e801abbc |
|
MD5 | 86e62d9c2dc17b7e2f1a34482aed17d6 |
|
BLAKE2b-256 | 709928f3b4a8dc2b4875e4b0e0e5c46c8a47267b533a5b9b554c15c2f56a05ed |
Close
Hashes for lru_cache_pubsub_cache_clear-0.0.2-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6da61acb882aa2e1cfc2d05552dd5b60c62186eadd17bf447eec56b46c6d9374 |
|
MD5 | 637e3800dfae222c46a01465189c617e |
|
BLAKE2b-256 | edd5dd3970e817ce96525e0fd90cd25841f1f6bc3fd41f92c13717c93d081168 |