lib/decorators/PopulateInDecorator.js
function PopulateInDecorator(cache, config) {
  BaseDecorator.call(this, cache, config, joi.object().keys({
    populateIn: joi.number().integer().min(500).required(),
    populateInAttempts: joi.number().integer().default(5),
    pausePopulateIn: joi.number().integer().required(),
    accessedAtThrottle: joi.number().integer().default(1000)
  }));

  this._store = this._getStore();
  this._timer = this._store.createTimer();
  this._timer.on('error', this._emitError);
  this._timer.on('timeout', this._onTimeout.bind(this));

  this.on('set:after', this.setTimeout.bind(this));
  this.on('get:after', throttle(this.setAccessedAt.bind(this),
    this._config.accessedAtThrottle));
}
function PopulateInDecorator(cache, config) {
  BaseDecorator.call(this, cache, config, joi.object().keys({
    populateIn: joi.number().integer().min(500).required(),
    populateInAttempts: joi.number().integer().default(5),
    pausePopulateIn: joi.number().integer().required(),
    accessedAtThrottle: joi.number().integer().default(1000)
  }));

  this._store = this._getStore();
  this._timer = this._store.createTimer();
  this._timer.on('error', this._emitError);
  this._timer.on('timeout', this._onTimeout.bind(this));

  this.on('set:after', this.setTimeout.bind(this));
  this.on('get:after', throttle(this.setAccessedAt.bind(this),
    this._config.accessedAtThrottle));
}
function PopulateInDecorator ( cache , config ) { BaseDecorator . call ( this , cache , config , joi . object ( ) . keys ( { populateIn : joi . number ( ) . integer ( ) . min ( 500 ) . required ( ) , populateInAttempts : joi . number ( ) . integer ( ) . default ( 5 ) , pausePopulateIn : joi . number ( ) . integer ( ) . required ( ) , accessedAtThrottle : joi . number ( ) . integer ( ) . default ( 1000 ) } ) ) ; this . _store = this . _getStore ( ) ; this . _timer = this . _store . createTimer ( ) ; this . _timer . on ( 'error' , this . _emitError ) ; this . _timer . on ( 'timeout' , this . _onTimeout . bind ( this ) ) ; this . on ( 'set:after' , this . setTimeout . bind ( this ) ) ; this . on ( 'get:after' , throttle ( this . setAccessedAt . bind ( this ) , this . _config . accessedAtThrottle ) ) ; }
Auto-populating Redis-backed cache

@constructor
@param {Cache} cache
@param {Object} [config]
@param {String} [config.populateIn]
@param {String} [config.populateInAttempts]
@param {String} [config.pausePopulateIn]
@param {String} [config.accessedAtThrottle]
Auto - populating Redis - backed cache