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)
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)
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)