examples/simple.js
function(args,next) {

    // do nothing now but in 1 sec

    setTimeout(function() {

        // if i'm job id 10 or 20, let's add
        // another job dynamicaly in the queue.
        // It can be usefull for network operation (retry on timeout)

        if (args._jobId==10||args._jobId==20) {
            myQueueJobs.add(myjob,[999,'bla '+args._jobId]);
        }
        next();
    },Math.random(1000)*2000);
}
function(args,next) {

    // do nothing now but in 1 sec

    setTimeout(function() {

        // if i'm job id 10 or 20, let's add
        // another job dynamicaly in the queue.
        // It can be usefull for network operation (retry on timeout)

        if (args._jobId==10||args._jobId==20) {
            myQueueJobs.add(myjob,[999,'bla '+args._jobId]);
        }
        next();
    },Math.random(1000)*2000);
}
function ( args , next ) { // do nothing now but in 1 sec setTimeout ( function ( ) { // if i'm job id 10 or 20, let's add // another job dynamicaly in the queue. // It can be usefull for network operation (retry on timeout) if ( args . _jobId == 10 || args . _jobId == 20 ) { myQueueJobs . add ( myjob , [ 999 , 'bla ' + args . _jobId ] ) ; } next ( ) ; } , Math . random ( 1000 ) * 2000 ) ; }
My non blocking main job
My non blocking main job