add a task to the chain
        takes the same parameters as async_task()
177130
def append(self, func, *args, **kwargs):
        
        self.chain.append((func, args, kwargs))
        # remove existing results
        if self.started:
            delete_group(self.group)
            self.started = False
        return self.length()
101059
public function add(Task $task) : void
    {
        $this->index++;
        Util::put($this -> storage().$this->index.'.queue', serialize($task));
        $this -> updateIterator();
        Util::put($this -> storage().'_index', $this -> index);
    }
1234216
def add_task(self, task, parent_task_result):
        
        self.tasks.append((task, parent_task_result))
        self.task_id_to_task[task.id] = task
1339483
function chain(tasks) {
      return function() {
        var pipeline = fullPipeline();

        _.each(tasks, function(task) {
          pipeline = pipeline.pipe(task.callback(options)());
        });

        return pipeline;
      };
    }
56781
def send(self, task_path, args, kwargs):
        
        message = {
                'task_path': task_path,
                'capture_response': self.capture_response,
                'response_id': self.response_id,
                'args': args,
                'kwargs': kwargs
            }
        self._send(message)
        return self
1004933
def add_task(self, fn, inputs=None, outputs=None):
        
        # self.tasks.append({'task': task, 'inputs': inputs, 'outputs': outputs})
        self.tasks.append(Task(fn, inputs, outputs))
        return self
1197006
function utilTask( methodCallback, methodType, methodSchema ) {
        function tackTask( opt, success ) {
            var async;

            success = success || Noop;
            
            if ( opt.async ) {
                async = opt.async;
                delete opt.async;
            }

            if ( async ) {
                nextTick( nextTickTask, methodCallback, this, opt, success, methodType );
            }
            else {
                nextTickTask( methodCallback, this, opt, success, methodType );
            }

            return this;
        }

        Object.defineProperty( tackTask, 'task', { value: methodSchema || true });
        Object.defineProperty( tackTask, 'callback', { value: methodCallback });

        return tackTask;
    }
532760
function(tasks, callback) {

      var keys; var length; var i; var results; var kind;
      var updated_tasks = [];
      var is_object;
      var counter = 0;

      if (isArray(tasks)) {

        length = tasks.length;
        results = [];

      } else if (isObject(tasks)) {

        is_object = true;
        keys = ObjectKeys(tasks);
        length = keys.length;
        results = {};

      } else {
        return callback();
      }

      for (i=0; i<length; i++) {

        if (is_object) {
          updated_tasks.push({ k: keys[i], t: tasks[keys[i]] });
        } else {
          updated_tasks.push({ k: i, t: tasks[i] });
        }

      }

      updated_tasks.forEach(function(task_object) {

        task_object.t(function(err, result) {
          if (err) return callback(err);

          results[task_object.k] = result;

          counter++;
          if (counter == length) callback(null, results);
        });

      });

    }
1142656
function(task, context, args) {
            // can used to default task
            if (!_.isFunction(task)) {
                args = task;
                task = null;
                context = null;
            }

            if (!_.isArray(args)) args = [args];

            var d = Q.defer();
            this.tasks.push({
                "task": task,
                "args": args || [],
                "context": context,
                "result": d
            });
            if (this.empty == true) {
                this.startNext();
            }
            return d.promise;
        }
443771
def insert(self, task, args=[], kwargs={}, delay_seconds=0):
    
    body = {
      "payload": task.payload(),
      "queueName": self._queue_name,
      "groupByTag": True,
      "tag": task.__class__.__name__
    }

    def cloud_insertion():
      self._api.insert(body, delay_seconds)

    self._pool.spawn(cloud_insertion)

    return self
378370
def addTask(self, task):
        
        with self.regcond:
            self.taskset.append(task)
            task.add_callback('resolved', self.child_done, self.numtasks)
            self.numtasks += 1
            self.count += 1

        task.initialize(self)
        task.start()
584751
void runTasks(Task[] tasks, int maxTaskIndex) {
        for (int i = 0; i <= maxTaskIndex; i++) {
            runTasksInChain(tasks[i]);
            tasks[i] = null;
        }
    }
522798
function(tasks, callback) {

      if (!isArray(tasks)) return callback();

      var length = tasks.length;
      var results = [];

      function runTask(index) {
        tasks[index](function(err, result) {
          if (err) return callback(err);
          results[index] = result;
          if (index < length - 1) return runTask(index + 1);
          return callback(null, results);
        });
      }

      runTask(0);
    }
304813
def add_tag(self, task, params={}, **options): 
        
        path = "/tasks/%s/addTag" % (task)
        return self.client.post(path, params, **options)
202719
def call_async(self, fn, *args, **kwargs):
        
        return self.default_call_chain.call_async(fn, *args, **kwargs)
517001
function update() {
		while (waiting.length && count < concurrency) (function() {
			var t = waiting.shift()
			
			if (inProg[t.task.id]) {
				inProg[t.task.id].push(t.cb)
				return
			} else {
				inProg[t.task.id] = [t.cb]
				count++
				processor(t.task, function() {
					var args = arguments

					if (!inProg[t.task.id]) return // probably callback called twice
	
					count--
					inProg[t.task.id].forEach(function(cb) { cb.apply(null, args) })
					delete inProg[t.task.id]
	
					setImmediate(update)
				})
			}	
		})()
	}
1155326
def put(self, task):
        

        if not self.connected:
            raise QueueNotConnectedError("Queue is not Connected")

        if task.unique:
            # first lets check if we have this hash already in our queue
            if not self.__db.sismember(self._lock_key, task.unique_hash()):
                self.__db.sadd(self._lock_key, task.unique_hash())
            else:
                raise TaskAlreadyInQueueException(
                    'Task already in Queue [{hash}]'.format(
                        hash=task.unique_hash()))

        self.__db.lpush(self._key, task.to_json())

        return True