MemoryEntityService Class
Memory storage service
Item Index
Methods
- _set
- createChangeHandler static
- dispose static
- static
- get
- getCorrectValueField static
- getKey static
- getSiteValue static
- onSet
- purge
- reap static
- set
- setKeyExpiration
- startReaper static
Properties
- GLOBAL_SITE static
- TIMERS static
- static
- static
- DEFAULT_REAPER_INTERVAL static
- TYPE static
Methods
_set
-
key
-
value
-
cb
Sets a value
Parameters:
-
key
String -
value
Object | String | Integer | Float | Boolean -
cb
Function
createChangeHandler
()
static
Creates a change handler that will update the value of a property when an incomming command requests it.
dispose
-
cb
Disposes of the storage and timers. It also terminates the reaping of expired keys.
Parameters:
-
cb
Function
Retrieves the command type that is to be used to listen for changes to key/value pairs within the registered instance
Returns:
The command type to be registered for
get
-
key
-
cb
Retrieve a value from memory
Parameters:
-
key
String -
cb
FunctionCallback function
getCorrectValueField
-
rawVal
-
valueField
Parameters:
-
rawVal
Object -
valueField
Object
Returns:
getKey
-
key
-
site
-
objType
Retrieves the internal key format for a given key
Parameters:
-
key
String -
site
String -
objType
String
Returns:
getSiteValue
-
self
-
internalKey
Parameters:
-
self
Object -
internalKey
Object
Returns:
onSet
-
key,
-
value
Called when when a value changes
Parameters:
-
key,
String -
value
Object | String | Integer | Float | Boolean
purge
-
key
-
cb
Purge the key from memory
Parameters:
-
key
String -
cb
FunctionCallback function
reap
()
Number
static
Searches for expired keys and removes them from memory
Returns:
The number of keys that were reaped
set
-
key
-
value
-
cb
Set a value in memory. Triggers a command to be sent to the cluster to update the value
Parameters:
-
key
String -
value
-
cb
FunctionCallback function
setKeyExpiration
-
key
Sets a timeout to purge a key after the configured timeout has occurred. If a timeout has already been set it will be cleared and a new one will be created.
Parameters:
-
key
StringThe key for the value to be cleared
startReaper
()
Boolean
static
Attempts to start the reaper that will remove expired keys from the in-memory cache
Returns:
TRUE if reaper is started, FALSE if it is already started
Properties
GLOBAL_SITE
String
private
static
TIMERS
Object
private
static
DEFAULT_REAPER_INTERVAL
Number
private
static
TYPE
String
private
static
The type string that describes the storage medium for the service