How to use the ring.disk 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_asyncio.py View on Github external
def storage_disk(request):
    client = diskcache.Cache('/tmp/ring-test/diskcache')
    return client, ring.disk
github youknowone / ring / tests / test_func_sync.py View on Github external
def disk_cache(request):
    client = request.param
    client.ring = ring.disk
    client.is_binary = False
    client.has_touch = False
    return client
github youknowone / ring / tests / test_func_sync.py View on Github external
    @ring.disk(storage_diskcache, 'ring-test')
    def f(a, b):
        r = base[0] + a * 100 + b
        sr = str(r)
        if storage_diskcache.is_binary:
            sr = sr.encode('utf-8')
        return sr
github youknowone / ring / tests / test_func_sync.py View on Github external
    @ring.disk(disk_cache, 'ring-test')
    def f(a, b):
        r = base[0] + a * 100 + b
        sr = str(r)
        if disk_cache.is_binary:
            sr = sr.encode('utf-8')
        return sr
github youknowone / ring / tests / test_func_sync.py View on Github external
def storage_diskcache(request):
    client = request.param
    client.ring = ring.disk
    client.is_binary = False
    client.has_has = False
    client.has_touch = False
    client.has_expire = True
    return client