lib/node.io/processor.js
function (job_name, job_obj) {

        //If we're capturing output, we need to explicitly override job.output()
        if (isMaster && capture_output) {
            var output = [];
            job_obj.output = function (out) {
                if (out instanceof Array && job_obj.options.flatten) {
                    for (var i = 0, l = out.length; i < l; i++) {
                        output.push(out[i]);
                    }
                } else {
                    output.push(out);
                }
            };
            var old_callback = callback;
            callback = function (err) {
                old_callback(err, output);
            };
        }

        //Are we distributing work?
        fork = job_obj.options.fork;

        //Initialise the processor
        processor.init(function () {

            //Start the job
            if (isMaster) {
                processor.startJob(job_name, job_obj, callback);
            }

        });
    }
function (job_name, job_obj) {

        //If we're capturing output, we need to explicitly override job.output()
        if (isMaster && capture_output) {
            var output = [];
            job_obj.output = function (out) {
                if (out instanceof Array && job_obj.options.flatten) {
                    for (var i = 0, l = out.length; i < l; i++) {
                        output.push(out[i]);
                    }
                } else {
                    output.push(out);
                }
            };
            var old_callback = callback;
            callback = function (err) {
                old_callback(err, output);
            };
        }

        //Are we distributing work?
        fork = job_obj.options.fork;

        //Initialise the processor
        processor.init(function () {

            //Start the job
            if (isMaster) {
                processor.startJob(job_name, job_obj, callback);
            }

        });
    }
function ( job_name , job_obj ) { //If we're capturing output, we need to explicitly override job.output() if ( isMaster && capture_output ) { var output = [ ] ; job_obj . output = function ( out ) { if ( out instanceof Array && job_obj . options . flatten ) { for ( var i = 0 , l = out . length ; i < l ; i ++ ) { output . push ( out [ i ] ) ; } } else { output . push ( out ) ; } } ; var old_callback = callback ; callback = function ( err ) { old_callback ( err , output ) ; } ; } //Are we distributing work? fork = job_obj . options . fork ; //Initialise the processor processor . init ( function ( ) { //Start the job if ( isMaster ) { processor . startJob ( job_name , job_obj , callback ) ; } } ) ; }
Callback for once we've loaded the job
Callback for once we ve loaded the job