bin/poolapi.js
function runExtensions(settings) {
  var extensions = settings.extensions,
      channels = settings.channels,
      connection = settings.connection,
      userPackage = settings.userPackage,
      server = settings.server;

  // For every extension the user listed...

  extensions.forEach(function (extension) {

    // Find the callbacks associated with that extension.
    var callbacks = channels[extension];

    // If there aren't any, we're trying to extend something that hasn't
    // been defined yet.
    if (!callbacks) {
      throw new Error('Can not extend channel ' + extension + ' because it does not exist.');

      // Otherwise, we can call each one.
    } else {
      callbacks.forEach(function (callback) {
        return callback(connection, userPackage, server);
      });
    }
  });
}
function runExtensions(settings) {
  var extensions = settings.extensions,
      channels = settings.channels,
      connection = settings.connection,
      userPackage = settings.userPackage,
      server = settings.server;

  // For every extension the user listed...

  extensions.forEach(function (extension) {

    // Find the callbacks associated with that extension.
    var callbacks = channels[extension];

    // If there aren't any, we're trying to extend something that hasn't
    // been defined yet.
    if (!callbacks) {
      throw new Error('Can not extend channel ' + extension + ' because it does not exist.');

      // Otherwise, we can call each one.
    } else {
      callbacks.forEach(function (callback) {
        return callback(connection, userPackage, server);
      });
    }
  });
}
function runExtensions ( settings ) { var extensions = settings . extensions , channels = settings . channels , connection = settings . connection , userPackage = settings . userPackage , server = settings . server ; // For every extension the user listed... extensions . forEach ( function ( extension ) { // Find the callbacks associated with that extension. var callbacks = channels [ extension ] ; // If there aren't any, we're trying to extend something that hasn't // been defined yet. if ( ! callbacks ) { throw new Error ( 'Can not extend channel ' + extension + ' because it does not exist.' ) ; // Otherwise, we can call each one. } else { callbacks . forEach ( function ( callback ) { return callback ( connection , userPackage , server ) ; } ) ; } } ) ; }
Runs a series of callbacks for a new connection.

@param  {Object} settings - All the values we'll need to run the callbacks.

@return {undefined}
Runs a series of callbacks for a new connection .