A Python function wrapper to cache method results using memcache
Usage:
from memcache_wrapper import Memcached
from mockcache import Client
mc_client = Client()
@Memcached('/myprefix', mc_client)
def myfunc(args):
...
or
mc = Memcached('/myprefix', mc_client)
cached_myfunc = mc.wrap(myfunc)
For short,
cached_myfunc = Memcached('/myprefix', mc_client).wrap(myfunc)
See more examples at test/test_memcache_wrapper.py
Parameters:
prefix: used as memached's key prefix
mc_client: memcache client instance, such as python-memcached or mockcache
ttl: time to live in memcache, default: 10
bypass_cache: if True, bypass cache and save the result
cache_negative: if False, do not cache negative result, such as [], {}, and None. Otherwise, it will cache everything.
Usage:
from memcache_wrapper import Memcached
from mockcache import Client
mc_client = Client()
@Memcached('/myprefix', mc_client)
def myfunc(args):
...
or
mc = Memcached('/myprefix', mc_client)
cached_myfunc = mc.wrap(myfunc)
For short,
cached_myfunc = Memcached('/myprefix', mc_client).wrap(myfunc)
See more examples at test/test_memcache_wrapper.py
Parameters:
prefix: used as memached's key prefix
mc_client: memcache client instance, such as python-memcached or mockcache
ttl: time to live in memcache, default: 10
bypass_cache: if True, bypass cache and save the result
cache_negative: if False, do not cache negative result, such as [], {}, and None. Otherwise, it will cache everything.
Metadata
Release files for memcache_wrapper 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| memcache_wrapper-1.0.4.tar.gz | 2.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| memcache_wrapper-1.0.4-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 6.8 kB
Release files / memcache_wrapper-1.0.4.tar.gz
| Download URL | memcache_wrapper-1.0.4.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5258635e038009793b1cb649c477fe0accece3084bcee2a3910ec841f1ee564b
|
|
BLAKE2b-256 checksum How to use checksums |
b889586284c85a9dd09eff067e1e838cd81f694a072705d4a0b91f05eda3c478
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / memcache_wrapper-1.0.4-py2-none-any.whl
| Download URL | memcache_wrapper-1.0.4-py2-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
dd556d879eba3d07382c95356fb01c3e7d1acea38de02f7ef17c8d3bc5c26cf7
|
|
BLAKE2b-256 checksum How to use checksums |
08aee8265ef4cffe2d146993c8c00670e93f122198065d9255aede0d69c41dce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |