lib/task.js
function(name)
{
  //Check if the queue exists
  if(typeof tasks[name] !== 'object'){ return; }

  //Check if queue is paused
  if(tasks[name].paused === true)
  {
    //Set task queue running false
    tasks[name].running = false;
  }
  else
  {
    //Set queue running
    tasks[name].running = true;

    //Check the number of tasks on this tag
    if(tasks[name].handlers.length === 0)
    {
      //Delete this path object
      delete tasks[name];
    }
    else
    {
      //Get the function to run
      var handler = tasks[name].handlers.shift();

      //Run this task
      return handler.call(null, function()
      {
        //Continue with the next task
        return process.nextTick(function()
        {
          //Continue with the next task in the queue
          return task_run(name);
        });
      });
    }
  }
}
function(name)
{
  //Check if the queue exists
  if(typeof tasks[name] !== 'object'){ return; }

  //Check if queue is paused
  if(tasks[name].paused === true)
  {
    //Set task queue running false
    tasks[name].running = false;
  }
  else
  {
    //Set queue running
    tasks[name].running = true;

    //Check the number of tasks on this tag
    if(tasks[name].handlers.length === 0)
    {
      //Delete this path object
      delete tasks[name];
    }
    else
    {
      //Get the function to run
      var handler = tasks[name].handlers.shift();

      //Run this task
      return handler.call(null, function()
      {
        //Continue with the next task
        return process.nextTick(function()
        {
          //Continue with the next task in the queue
          return task_run(name);
        });
      });
    }
  }
}
function ( name ) { //Check if the queue exists if ( typeof tasks [ name ] !== 'object' ) { return ; } //Check if queue is paused if ( tasks [ name ] . paused === true ) { //Set task queue running false tasks [ name ] . running = false ; } else { //Set queue running tasks [ name ] . running = true ; //Check the number of tasks on this tag if ( tasks [ name ] . handlers . length === 0 ) { //Delete this path object delete tasks [ name ] ; } else { //Get the function to run var handler = tasks [ name ] . handlers . shift ( ) ; //Run this task return handler . call ( null , function ( ) { //Continue with the next task return process . nextTick ( function ( ) { //Continue with the next task in the queue return task_run ( name ) ; } ) ; } ) ; } } }
Run a task by name
Run a task by name