Ejemplo n.º 1
0
def patch_cache_lfu(lock_obj):
    import lfu_cache
    import lfu_cache_with_lock
    lfu_lock1lvl = lfu_cache_with_lock.create_cache1lvl(lock_obj)
    lfu_lock2lvl = lfu_cache_with_lock.create_cache2lvl(lock_obj)
    __patch(lfu_cache, 'cache1lvl', lfu_lock1lvl)
    __patch(lfu_cache, 'cache2lvl', lfu_lock2lvl)
Ejemplo n.º 2
0
def patch_cache_lfu(lock_obj):
    import lfu_cache
    import lfu_cache_with_lock
    lfu_lock1lvl = lfu_cache_with_lock.create_cache1lvl(lock_obj)
    lfu_lock2lvl = lfu_cache_with_lock.create_cache2lvl(lock_obj)
    __patch(lfu_cache, 'cache1lvl', lfu_lock1lvl)
    __patch(lfu_cache, 'cache2lvl', lfu_lock2lvl)
Ejemplo n.º 3
0
def patch_cache_lfu(lock_obj):
    """
    Patnches cache mechanizm to be thread safe (gevent ones also)

    .. note::

       It's internal maras mechanizm, it will be called when needed

    """
    import lfu_cache
    import lfu_cache_with_lock
    lfu_lock1lvl = lfu_cache_with_lock.create_cache1lvl(lock_obj)
    lfu_lock2lvl = lfu_cache_with_lock.create_cache2lvl(lock_obj)
    __patch(lfu_cache, 'cache1lvl', lfu_lock1lvl)
    __patch(lfu_cache, 'cache2lvl', lfu_lock2lvl)
Ejemplo n.º 4
0
def patch_cache_lfu(lock_obj):
    """
    Patnches cache mechanizm to be thread safe (gevent ones also)

    .. note::

       It's internal CodernityDB mechanizm, it will be called when needed

    """
    import lfu_cache
    import lfu_cache_with_lock
    lfu_lock1lvl = lfu_cache_with_lock.create_cache1lvl(lock_obj)
    lfu_lock2lvl = lfu_cache_with_lock.create_cache2lvl(lock_obj)
    __patch(lfu_cache, 'cache1lvl', lfu_lock1lvl)
    __patch(lfu_cache, 'cache2lvl', lfu_lock2lvl)