Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(42)  |  Call(25)  |  Derive(0)  |  Import(17)
Ram based caching

This is implemented as global (per process, shared by all threads)
dictionary.
A mutex-lock mechanism avoid conflicts.

src/o/p/openshift_web2py-HEAD/libs/gluon/main.py   openshift_web2py(Download)
from settings import global_settings
from validators import CRYPT
from cache import CacheInRam
from html import URL, xmlescape
from utils import is_valid_ip_address, getipaddrinfo
        return dest
    cache_key = 'X-Progress-ID:' + request.vars['X-Progress-ID']
    cache_ram = CacheInRam(request)  # same as cache.ram because meta_storage
    cache_ram(cache_key + ':length', lambda: size, 0)
    cache_ram(cache_key + ':uploaded', lambda: 0, 0)
            break
    dest.seek(0)
    cache_ram(cache_key + ':length', None)
    cache_ram(cache_key + ':uploaded', None)
    return dest

src/w/e/web2py-2.1.1/gluon/main.py   web2py(Download)
from settings import global_settings
from validators import CRYPT
from cache import CacheInRam
from html import URL, xmlescape
from utils import is_valid_ip_address
        return dest
    cache_key = 'X-Progress-ID:'+request.vars['X-Progress-ID']
    cache_ram = CacheInRam(request)  # same as cache.ram because meta_storage
    cache_ram(cache_key+':length', lambda: size, 0)
    cache_ram(cache_key+':uploaded', lambda: 0, 0)
            break
    dest.seek(0)
    cache_ram(cache_key+':length', None)
    cache_ram(cache_key+':uploaded', None)
    return dest

src/t/e/termite-visualizations-HEAD/web2py/gluon/tests/test_dal.py   termite-visualizations(Download)
    def testRun(self):
        from cache import CacheInRam
        cache = CacheInRam()
        db = DAL(DEFAULT_URI, check_reserved=['all'])
        db.define_table('tt', Field('aa'))

src/t/e/termite-visualizations-HEAD/web2py/gluon/tests/test_cache.py   termite-visualizations(Download)
 
from storage import Storage
from cache import CacheInRam, CacheOnDisk
 
oldcwd = None
    def testCacheInRam(self):
 
        # defaults to mode='http'
 
        cache = CacheInRam()

src/t/e/termite-data-server-HEAD/web2py/gluon/tests/test_dal_nosql.py   termite-data-server(Download)
    def testRun(self):
        from cache import CacheInRam
        cache = CacheInRam()
        db = DAL(DEFAULT_URI, check_reserved=['all'])
        db.define_table('tt', Field('aa'))

src/t/e/termite-data-server-HEAD/web2py/gluon/tests/test_dal.py   termite-data-server(Download)
    def testRun(self):
        from cache import CacheInRam
        cache = CacheInRam()
        db = DAL(DEFAULT_URI, check_reserved=['all'])
        db.define_table('tt', Field('aa'))

src/t/e/termite-data-server-HEAD/web2py/gluon/tests/test_cache.py   termite-data-server(Download)
 
from storage import Storage
from cache import CacheInRam, CacheOnDisk
 
oldcwd = None
    def testCacheInRam(self):
 
        # defaults to mode='http'
 
        cache = CacheInRam()

src/m/o/MobileBlur-HEAD/gluon/tests/test_cache.py   MobileBlur(Download)
import unittest
from storage import Storage
from cache import CacheInRam, CacheOnDisk
 
oldcwd = None
    def testCacheInRam(self):
 
        # defaults to mode='http'
 
        cache = CacheInRam()

src/w/e/web2cms-HEAD/web2py/gluon/tests/test_cache.py   web2cms(Download)
import unittest
from storage import Storage
from cache import CacheInRam, CacheOnDisk
 
oldcwd = None
    def testCacheInRam(self):
 
        # defaults to mode='http'
 
        cache = CacheInRam()

src/w/e/web2py-python3-HEAD/gluon/tests/test_cache.py   web2py-python3(Download)
import unittest
from storage import Storage
from cache import CacheInRam, CacheOnDisk
 
oldcwd = None
    def testCacheInRam(self):
 
        # defaults to mode='http'
 
        cache = CacheInRam()

  1 | 2  Next