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:
-
keyString -
valueObject | String | Integer | Float | Boolean -
cbFunction
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:
-
cbFunction
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:
-
keyString -
cbFunctionCallback function
getCorrectValueField
-
rawVal -
valueField
Parameters:
-
rawValObject -
valueFieldObject
Returns:
getKey
-
key -
site -
objType
Retrieves the internal key format for a given key
Parameters:
-
keyString -
siteString -
objTypeString
Returns:
getSiteValue
-
self -
internalKey
Parameters:
-
selfObject -
internalKeyObject
Returns:
onSet
-
key, -
value
Called when when a value changes
Parameters:
-
key,String -
valueObject | String | Integer | Float | Boolean
purge
-
key -
cb
Purge the key from memory
Parameters:
-
keyString -
cbFunctionCallback 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:
-
keyString -
value -
cbFunctionCallback 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:
-
keyStringThe 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
