RamCache class

Arbitary storage of objects in memory for later use.

purpose

  • Objects are stored with a key for retrieval.
  • The cache can be segmented per session to prevent unintended crosstalk for server side caches
  • The cache is implemented with static methods so that it can be used without explicitily creating instances of RamCache

##Node Examples

RamCache.remember('MyKey', value);
print(RamCache.recall('MyKey'));
RamCache.forget('MyKey');

##Session Examples

RamCache.remember('MyKey', value, SessionGUID);
print(RamCache.recall('MyKey', SessionGUID));
RamCache.forget('MyKey', SessionGUID);

##Incorrect Examples

var myCache = New RamCache(); //there is no need to use new
myCache.remember('MyKey', value); //this will not spawn a new cache, it will use the common node cache

Constructors

RamCache([dynamic session])
Creates a new session cache or returns an exisiting session cache.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

destroySessionCache(dynamic session) → dynamic
Removes all values for a particular session.
forget(dynamic key, [dynamic session]) Object?
Removes a value from the cache perminantly.
recall(dynamic key, [dynamic session]) Object?
Retrieves a previously stored value from the cache using key.
remember(dynamic key, dynamic value, [dynamic session]) → dynamic
Stores a value in the cache for later retrival using key.