Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
nameko_cache-1.0.6-py2-none-any.whl (2.3 kB) Copy SHA256 hash SHA256 Wheel py2
nameko-cache-1.0.6.win32.zip (3.7 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page