Cache for nameko services
Project description
nameko-cache
Cache for nameko services
Installation
pip install nameko-cache
Usage
app.py
from datetime import datetime
from nameko.rpc import rpc
from nameko_redisy import Redis
from nameko_cache import cached, delete_cached
class FooService(object):
name = 'foo_service'
cache = Redis('CACHE_REDIS_URI')
@rpc
@cached(timeout=10)
def hello(name):
return 'hello {} at {}'.format(name, datetime.now())
@rpc
def world(self):
delete_cached(self.hello, ['john'])
config.yml
AMQP_URI: 'pyamqp://guest:guest@localhost'
CACHE_REDIS_URI: 'redis://127.0.0.1'
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
nameko-cache-1.0.2.win32.zip
(3.6 kB
view details)
Built Distribution
File details
Details for the file nameko-cache-1.0.2.win32.zip
.
File metadata
- Download URL: nameko-cache-1.0.2.win32.zip
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecf18fe71f440d9498c3d9462e681dd3a1920f942738614baf3e3bfa0acf5fb3 |
|
MD5 | 47604f13fadd6a868aea52d6f05ce76a |
|
BLAKE2b-256 | efb4e378a5b605ae8ee11d639aa1de29ed3a9620dccefc6e721e4749b9ae91d5 |
File details
Details for the file nameko_cache-1.0.2-py2-none-any.whl
.
File metadata
- Download URL: nameko_cache-1.0.2-py2-none-any.whl
- Upload date:
- Size: 2.2 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 363a945bc7d18b95bfd7a4c82b1954bbc8aa5b35958f65b47a490feacf5b239e |
|
MD5 | e4090b43c2599dd0950a336dc2ec5d19 |
|
BLAKE2b-256 | cb9f82b1f889d8f4107775dee805fd0823dab4789f1f8d4189c9177eab2d91cf |