semvec/pypi-packages huggingface dataset:
nameko-cache 1.0.6
Cache for nameko services
License: Apache License, Version 2.0

# nameko-cache

Cache for nameko services

## Installation
```
pip install nameko-cache
```

## Usage
app.py
```python
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
```yml
AMQP_URI: 'pyamqp://guest:guest@localhost'
CACHE_REDIS_URI: 'redis://127.0.0.1'
```