plugins/lib/crusher.js
function message(worker, task) {
    var callback = worker.queue[task.id]
      , err;

    // Rebuild the Error object so we can pass it to our callbacks
    if (task.err) {
      err = new Error(task.err.message);
      err.stack = task.err.stack;
    }

    // Kill the whole fucking system, we are in a fucked up state and should die
    // badly, so just throw something and have the process.uncaughtException
    // handle it.
    if (!callback) {
      if (err) console.error(err);
      console.error(task);
      throw new Error('Unable to process message from worker, can\'t locate the callback!');
    }

    callback(err, task);
    delete worker.queue[task.id];
  }
function message(worker, task) {
    var callback = worker.queue[task.id]
      , err;

    // Rebuild the Error object so we can pass it to our callbacks
    if (task.err) {
      err = new Error(task.err.message);
      err.stack = task.err.stack;
    }

    // Kill the whole fucking system, we are in a fucked up state and should die
    // badly, so just throw something and have the process.uncaughtException
    // handle it.
    if (!callback) {
      if (err) console.error(err);
      console.error(task);
      throw new Error('Unable to process message from worker, can\'t locate the callback!');
    }

    callback(err, task);
    delete worker.queue[task.id];
  }
function message ( worker , task ) { var callback = worker . queue [ task . id ] , err ; // Rebuild the Error object so we can pass it to our callbacks if ( task . err ) { err = new Error ( task . err . message ) ; err . stack = task . err . stack ; } // Kill the whole fucking system, we are in a fucked up state and should die // badly, so just throw something and have the process.uncaughtException // handle it. if ( ! callback ) { if ( err ) console . error ( err ) ; console . error ( task ) ; throw new Error ( 'Unable to process message from worker, can\'t locate the callback!' ) ; } callback ( err , task ) ; delete worker . queue [ task . id ] ; }
Message handler for the workers.

@param {Worker} worker
@param {Error} err
@param {Object} task the updated task
@api private
Message handler for the workers .