lib/defaultCommandHandler.js
function (aggregateId, callback) {
    if (!aggregateId || !_.isString(aggregateId)) {
      var err = new Error('Please pass a valid aggregateId!');
      debug(err);
      throw err;
    }
    if (!callback || !_.isFunction(callback)) {
      var err = new Error('Please pass a valid callback!');
      debug(err);
      throw err;
    }
    this.aggregateLock.reserve(this.id, aggregateId, callback);
  }
function (aggregateId, callback) {
    if (!aggregateId || !_.isString(aggregateId)) {
      var err = new Error('Please pass a valid aggregateId!');
      debug(err);
      throw err;
    }
    if (!callback || !_.isFunction(callback)) {
      var err = new Error('Please pass a valid callback!');
      debug(err);
      throw err;
    }
    this.aggregateLock.reserve(this.id, aggregateId, callback);
  }
function ( aggregateId , callback ) { if ( ! aggregateId || ! _ . isString ( aggregateId ) ) { var err = new Error ( 'Please pass a valid aggregateId!' ) ; debug ( err ) ; throw err ; } if ( ! callback || ! _ . isFunction ( callback ) ) { var err = new Error ( 'Please pass a valid callback!' ) ; debug ( err ) ; throw err ; } this . aggregateLock . reserve ( this . id , aggregateId , callback ) ; }
Locks the aggregate.
@param {String}   aggregateId The passed aggregateId.
@param {Function} callback    The function, that will be called when this action is completed.
`function(err){}`
Locks the aggregate .