API Docs for: 0.8.0
Show:

MemoryEntityService Class

Module: Storage
Parent Module: Services

Memory storage service

Item Index

Methods

Properties

Methods

_set

(
  • key
  • value
  • cb
)
private

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
)
static

Disposes of the storage and timers. It also terminates the reaping of expired keys.

Parameters:

  • cb Function

() String static

Retrieves the command type that is to be used to listen for changes to key/value pairs within the registered instance

Returns:

String:

The command type to be registered for

get

(
  • key
  • cb
)

Retrieve a value from memory

Parameters:

  • key String
  • cb Function

    Callback function

getCorrectValueField

(
  • rawVal
  • valueField
)
private static

Parameters:

  • rawVal Object
  • valueField Object

Returns:

:

getKey

(
  • key
  • site
  • objType
)
String static

Retrieves the internal key format for a given key

Parameters:

  • key String
  • site String
  • objType String

Returns:

String:

getSiteValue

(
  • self
  • internalKey
)
private static

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 Function

    Callback function

reap

() Number static

Searches for expired keys and removes them from memory

Returns:

Number:

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 Function

    Callback 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 String

    The 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:

Boolean:

TRUE if reaper is started, FALSE if it is already started

Properties

GLOBAL_SITE

String private static

TIMERS

Object private static

Object private static

Number private static

DEFAULT_REAPER_INTERVAL

Number private static

TYPE

String private static

The type string that describes the storage medium for the service