lib/InMemoryCache.js
/**
 * A complete in-memory in-process cache. It stores all the key/values in memory
 * and usually keeps them for a short period of time. The purpose is to accommodate
 * the access patterns where the same piece of data is required for multiple times
 * in a short period of time.
 *
 * You can set the TTL of each invidicual key, and you can also set a global TTL
 * for all the keys. A reaper is invoked periodically to remove expired keys.
 *
 * @constructor
 * @extends CacheInstance
 */
A complete in-memory in-process cache. It stores all the key/values in memory
and usually keeps them for a short period of time. The purpose is to accommodate
the access patterns where the same piece of data is required for multiple times
in a short period of time.

You can set the TTL of each invidicual key, and you can also set a global TTL
for all the keys. A reaper is invoked periodically to remove expired keys.


A complete in - memory in - process cache . It stores all the key / values in memory and usually keeps them for a short period of time . The purpose is to accommodate the access patterns where the same piece of data is required for multiple times in a short period of time . You can set the TTL of each invidicual key and you can also set a global TTL for all the keys . A reaper is invoked periodically to remove expired keys .
function InMemoryCache() {
  CacheInstance.call(this)
  this._data = {}
  this._expireAt = {}
  this._reaperIntervalMs = 2500
  this._maxAgeOverride = false
  this._reaperInterval = null
  this._isAvailable = false
}
function InMemoryCache ( ) { CacheInstance . call ( this ) this . _data = { } this . _expireAt = { } this . _reaperIntervalMs = 2500 this . _maxAgeOverride = false this . _reaperInterval = null this . _isAvailable = false }
A complete in-memory in-process cache.
A complete in - memory in - process cache .
// stores all of the caches values // the key is the same as the one in _data, the value is time after which the key can be reaped // run the reaper runs at least once every this many milliseconds // if this is set to a number > 0, each item will live this many ms instead // of maxAgesMs passed in to set/mset // The reaper interval