lib/decorators/PopulateDecorator.js
function PopulateDecorator(cache, config) {
  BaseDecorator.call(this, cache, config, joi.object().keys({
    populate: joi.func().required(),
    timeoutPopulateIn: joi.number().integer().default(1000 * 30),
    leaseExpiresIn: joi.number().integer()
  }));
  this._store = this._getStore();
  this._lease = this._store.createLease(
    this._config.leaseExpiresIn || this._config.timeoutPopulateIn + 1000);
  this.on('get:stale', this._onStaleEvent.bind(this));
}
function PopulateDecorator(cache, config) {
  BaseDecorator.call(this, cache, config, joi.object().keys({
    populate: joi.func().required(),
    timeoutPopulateIn: joi.number().integer().default(1000 * 30),
    leaseExpiresIn: joi.number().integer()
  }));
  this._store = this._getStore();
  this._lease = this._store.createLease(
    this._config.leaseExpiresIn || this._config.timeoutPopulateIn + 1000);
  this.on('get:stale', this._onStaleEvent.bind(this));
}
function PopulateDecorator ( cache , config ) { BaseDecorator . call ( this , cache , config , joi . object ( ) . keys ( { populate : joi . func ( ) . required ( ) , timeoutPopulateIn : joi . number ( ) . integer ( ) . default ( 1000 * 30 ) , leaseExpiresIn : joi . number ( ) . integer ( ) } ) ) ; this . _store = this . _getStore ( ) ; this . _lease = this . _store . createLease ( this . _config . leaseExpiresIn || this . _config . timeoutPopulateIn + 1000 ) ; this . on ( 'get:stale' , this . _onStaleEvent . bind ( this ) ) ; }
Self-populating data-store independent cache

@param {Cache} cache
@param {Object} config
@param {Function} config.populate
@param {Number} [config.leaseExpiresIn] in ms
@param {Number} [config.timeoutPopulateIn] in ms, defaults to 30sec
Self - populating data - store independent cache