How to use the ring.memcache function in ring

To help you get started, we’ve selected a few ring examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github youknowone / ring / tests / test_func_sync.py View on Github external
    @ring.memcache(pythonmemcache_client, expire=1)
    def simple(key):
        return key
github youknowone / ring / tests / test_func_sync.py View on Github external
    @ring.memcache(client, coder='json')
    def f(a):
        return a
github youknowone / ring / tests / test_coder.py View on Github external
    @ring.memcache(mc, coder='pickle')
    def now():
        return datetime.datetime.now()
github youknowone / ring / tests / test_func_sync.py View on Github external
    @ring.memcache(memcache_client, 'ring-test')
    def f(a, b):
        r = base[0] + a * 100 + b
        sr = str(r)
        if memcache_client.is_binary:
            sr = sr.encode('utf-8')
        return sr
github youknowone / ring / tests / test_memcache.py View on Github external
    @ring.memcache(memcache_client, 'ring-test', coder='json')
    def f(a, b):
        return a * 100 + b
github youknowone / ring / tests / test_readme.py View on Github external
    @ring.memcache(mc, expire=60)
    def get_url(url):
        return requests.get(url).content