function Task(basedir, jobId, nodes, datasetId, pid, action) {
518226
function Task(init) {
  this.basedir = init.basedir;
  this.bundle = init.bundle;
  this.datasetId = init.datasetId;
  this.pid = init.pid;
  this.nodes = init.nodes;
  this.action = init.action;
  this.outputStreamOk = true;
  this.files = {};      // object in which we store shuffle file informations to be sent back to master
//  this.lib;         // handler to libraries required on worker side (which cannot be serialized)
//  this.mm;          // handler to worker side memory manager instance
//  this.grid;          // handler to socket object instance
}
42594
function createTask(taskId) {
	return function (done) {
		var stream = tasks[taskId].fn(gulp, done);
		if (stream) {
			if (stream.on) stream.on('end', done);
			if (stream.then) stream.then(done);
		}
	};
}
1244420
function taskComplete() {
  winston.info(_pkgname + "task done #"+this.id + ' [' + this.data.id + ']');
  // now instantiate the next set of tasks
  //issueJobsNextLevel(this.data.jobname, this, this.data.flow);
  if(this.data._done) {
    this.data._done(this);
  }
}
1266320
public function onTask($server, $taskId, $srcWorkerId, $data)
    {
        $this->container->event->trigger('swoole.task', func_get_args());

        try {
            // push websocket message
            if ($this->isWebsocketPushPayload($data)) {
                $this->pushMessage($server, $data['data']);
                // push async task to queue
            }
        } catch (Throwable $e) {
            $this->logServerError($e);
        }
    }
534325
function createNewTask(task) {
        console.log("Creating task...");

        //set up the new list item
        const listItem = document.createElement("li");
        const checkBox = document.createElement("input");
        const label = document.createElement("label");


        //pull the inputed text into label
        label.innerText = task;

        //add properties
        checkBox.type = "checkbox";

        //add items to the li
        listItem.appendChild(checkBox);
        listItem.appendChild(label);
        //everything put together
        return listItem;
    }
11068
function runTask(taskName, directories, options, argv) {
	return new Promise((resolve, reject) => {
		const modulePath = tryResolve(
			tryFile(directories, `${taskName}/index.js`),
			`mrm-task-${taskName}`,
			taskName
		);

		if (!modulePath) {
			reject(new MrmUnknownTask(`Task “${taskName}” not found.`, { taskName }));
			return;
		}

		console.log(kleur.cyan(`Running ${taskName}...`));

		const module = require(modulePath);
		Promise.resolve(module(getConfigGetter(options), argv))
			.then(() => {
				resolve();
			})
			.catch(reject);
	});
}
748505
function() {
    firstTaskTimeout = clearTimeout(firstTaskTimeout);
    const task = taskQueue.shift();

    if (task) {
      const conn = idleConnections.shift();
      if (conn) {
        activeConnections[conn.threadId] = conn;
        resetTimeoutToNextTask();
        processTask(conn, task.sql, task.values, task.isBatch)
          .then(task.resolve)
          .catch(task.reject);
      } else {
        taskQueue.unshift(task);
      }
    }
  }
838881
def from_node(cls, task):
        """"""
        new = super().from_node(task)

        new.update(
            executable=task.executable,
            #executable_version:
            #task_events=
            pseudos=[p.as_dict() for p in task.input.pseudos],
            #input=task.input
        )

        new.register_gridfs_files(
            run_abi=(task.input_file.path, "t"),
            run_abo=(task.output_file.path, "t"),
        )

        return new
41421
function forEach(data, task, callback) {

		var wrapTask,
		    isArray,
		    subject,
		    test,
		    len,
		    i;

		isArray = Array.isArray(data);
		i = -1;

		if (isArray) {
			subject = data;

			wrapTask = function wrapTask(next) {
				task(subject[i], i, next);
			};
		} else {
			subject = Bound.Object.dissect(data);

			wrapTask = function wrapTask(next) {
				task(subject[i].value, subject[i].key, next);
			};
		}

		len = subject.length;
		test = function test() {
			return ++i < len;
		};

		return Blast.Collection.Function['while'](test, wrapTask, callback);
	}
1309827
function updateTask(task, callback) {
    database.serialize(function() {
      var expiry_time = getExpiryTime(task);
      var update_task = "UPDATE "+table_name+" SET task = ?, "
      +"at = datetime("+expiry_time+") WHERE "+table_name+".id = ?";

      log.debug('sqlite-adapter','Running query:',update_task);
      database.run(update_task, JSON.stringify(task), task.id, function(error) {
        if (error) {
          callback(error);
        }
        callback(error, this.changes);
      });
    });
  }
491824
public synchronized void executeTask(long jobId, int taskId, JobConfig jobConfig,
      Serializable taskArgs, RunTaskContext context) {
    Future<?> future = mTaskExecutionService
        .submit(new TaskExecutor(jobId, taskId, jobConfig, taskArgs, context, this));
    Pair<Long, Integer> id = new Pair<>(jobId, taskId);
    mTaskFutures.put(id, future);
    TaskInfo.Builder taskInfo = TaskInfo.newBuilder();
    taskInfo.setJobId(jobId);
    taskInfo.setTaskId(taskId);
    taskInfo.setStatus(Status.RUNNING);
    mUnfinishedTasks.put(id, taskInfo);
    mTaskUpdates.put(id, taskInfo.build());
    LOG.info("Task {} for job {} started", taskId, jobId);
  }
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);
        });

      });

    }
399012
function (job, config, callback) {
    var task = {
      job: job,
      config: config,
      callback: callback || function () {
      }
    };

    task.id = task.job._id;

    // Tasks with identical keys will be prevented from being scheduled concurrently.
    task.key = task.job.project + branchFromJob(task.job);

    this.tasks.push(task);

    // Defer task execution to the next event loop tick to ensure that the push() function's
    // callback is *always* invoked asynchronously.
    // http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony
    process.nextTick(this.drain.bind(this));
  }
1327275
function(data, taskList) {
		var tasks = {};

		for (var key in taskList) {
			var module = taskList[key].split('.');
			if (!procsObj[module[0]]) return {
				'err': true,
				'tasks': module
			};
			var procsInst = new procsObj[module[0]](request, response, data);
			if (!procsInst[module[1]]) return {
				'err': true,
				'tasks': module
			};
			tasks[module[0] + '_' + module[1]] = procsInst[module[1]];
		}
		return {
			'err': false,
			'tasks': tasks
		};
	}
1261878
function compose(task) {

   // Already composed action.
   if (task.action)
      return task.action

   // 1. named task.
   if (typeof task === "string")
      return task

   // 2. a function directly.
   if (typeof task === "function")
      return task.length ? task : () => Promise.resolve(task())

   // 3. task object.
   if (typeof task !== "object")
      throw new Error("A task must be a string, function, or object.")

   if (task.watch === true) {
      // Watching task without a valid path.
      if (!task.src)
         throw new Error("No path given to watch.")
      task.watch = task.src
   }


   let transform

   if (task.src)
      transform = () => pipify(task)

   // No transform function and no series/parallel.
   if (!transform && !task.series && !task.parallel)
      throw new Error("A task must do something.")

   // Both series and parallel.
   if (task.series && task.parallel)
      throw new Error("A task can't have both .series and .parallel properties.")

   // Only transform function.
   if (!task.series && !task.parallel) {
      task.action = transform
   }

   // Series/parallel sequence of tasks.
   else {
      const sequence = task.series ? "series" : "parallel"
      if (transform)
         task[sequence].push(transform)
      task.action = gulp[sequence](...task[sequence].map(compose))
   }

   return task.action

}
304858
def run_task(task_cls, task_data):
    
    task = instantiate(task_cls)
    task_callable = get_callable(task)
    return task_callable(TaskData(task_data))
1238005
function Task(options) {
  if (!(this instanceof Task)) {
    return new Task(options);
  }

  utils.is(this, 'task');
  use(this);

  this.options = options || {};
  if (utils.isTask(options)) {
    this.options = {};
    this.addTargets(options);
    return this;
  }
}