Docs for cache.ram

[ Python Tutorial ] [ Python Libraries ] [ web2py epydoc ]

Description


<class 'gluon.cache.CacheInRam'>









Ram based caching

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


Attributes


cache.ram.__call__ <type 'instancemethod'> belongs to class <type 'instancemethod'>
Attention! cache.ram does not copy the cached object. It just stores a reference to it. Turns out the deepcopying the object has some problems: - would break backward compatibility - would be limiting because people may want to cache live objects - would work unless we deepcopy no storage and retrival which would make things slow. Anyway. You can deepcopy explicitly in the function generating the value to be cached.

cache.ram.__class__ <type 'type'> extends (<class 'gluon.cache.CacheAbstract'>,) belongs to class <type 'type'>
Ram based caching This is implemented as global (per process, shared by all threads) dictionary. A mutex-lock mechanism avoid conflicts.

cache.ram.__delattr__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__delattr__('name') <==> del x.name

cache.ram.__dict__ <type 'dict'> belongs to class <type 'dict'>
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

cache.ram.__doc__ <type 'str'> belongs to class <type 'str'>
str(object='') -> string Return a nice string representation of the object. If the argument is a string, the return value is the same object.

cache.ram.__format__ <type 'builtin_function_or_method'> belongs to class <type 'builtin_function_or_method'>
default object formatter

cache.ram.__getattribute__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__getattribute__('name') <==> x.name

cache.ram.__hash__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__hash__() <==> hash(x)

cache.ram.__init__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

cache.ram.__module__ <type 'str'> belongs to class <type 'str'>
str(object='') -> string Return a nice string representation of the object. If the argument is a string, the return value is the same object.

cache.ram.__new__ <type 'builtin_function_or_method'> belongs to class <type 'builtin_function_or_method'>
T.__new__(S, ...) -> a new object with type S, a subtype of T

cache.ram.__reduce__ <type 'builtin_function_or_method'> belongs to class <type 'builtin_function_or_method'>
helper for pickle

cache.ram.__reduce_ex__ <type 'builtin_function_or_method'> belongs to class <type 'builtin_function_or_method'>
helper for pickle

cache.ram.__repr__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__repr__() <==> repr(x)

cache.ram.__setattr__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__setattr__('name', value) <==> x.name = value

cache.ram.__sizeof__ <type 'builtin_function_or_method'> belongs to class <type 'builtin_function_or_method'>
__sizeof__() -> int size of object in memory, in bytes

cache.ram.__str__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__str__() <==> str(x)

cache.ram.__subclasshook__ <type 'builtin_function_or_method'> belongs to class <type 'builtin_function_or_method'>
Abstract classes can override this to customize issubclass(). This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

cache.ram.__weakref__ <type 'NoneType'> belongs to class <type 'NoneType'>

cache.ram._clear <type 'instancemethod'> belongs to class <type 'instancemethod'>
Auxiliary function called by `clear` to search and clear cache entries

cache.ram.app <type 'str'> belongs to class <type 'str'>
str(object='') -> string Return a nice string representation of the object. If the argument is a string, the return value is the same object.

cache.ram.cache_stats_name <type 'str'> belongs to class <type 'str'>
str(object='') -> string Return a nice string representation of the object. If the argument is a string, the return value is the same object.

cache.ram.clear <type 'instancemethod'> belongs to class <type 'instancemethod'>

cache.ram.increment <type 'instancemethod'> belongs to class <type 'instancemethod'>

cache.ram.initialize <type 'instancemethod'> belongs to class <type 'instancemethod'>

cache.ram.initialized <type 'bool'> belongs to class <type 'bool'>
bool(x) -> bool Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

cache.ram.locker <type 'thread.lock'> belongs to class <type 'thread.lock'>
A lock object is a synchronization primitive. To create a lock, call the PyThread_allocate_lock() function. Methods are: acquire() -- lock the lock, possibly blocking until it can be obtained release() -- unlock of the lock locked() -- test whether the lock is currently locked A lock is not owned by the thread that locked it; another thread may unlock it. A thread attempting to lock a lock that it has already locked will block until another thread unlocks it. Deadlocks may ensue.

cache.ram.max_ram_utilization <type 'NoneType'> belongs to class <type 'NoneType'>

cache.ram.meta_storage <type 'dict'> belongs to class <type 'dict'>
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

cache.ram.request <class 'gluon.globals.Request'> belongs to class <class 'gluon.globals.Request'>
Defines the request object and the default values of its members - env: environment variables, by gluon.main.wsgibase() - cookies - get_vars - post_vars - vars - folder - application - function - args - extension - now: datetime.datetime.now() - utcnow : datetime.datetime.utcnow() - is_local - is_https - restful()

cache.ram.stats <type 'dict'> belongs to class <type 'dict'>
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

cache.ram.storage <class 'collections.OrderedDict'> belongs to class <class 'collections.OrderedDict'>
Dictionary that remembers insertion order