Runs task through selected driver
@param {string} task_name registered task name
@param {object} options task options
@param {string} driver_name registered driver name
@return {Promise}
510795
function run(task_name, options, driver_name) {
  var task = this.tasks[task_name];
  if (!task) {
    log.error(new Error('Task "' + task_name + '" is not registered.'));
    return;
  }
  var driver = this.drivers[driver_name];
  if (!driver) {
    log.error(new Error('Driver "' + driver_name + '" is not registered.'));
    return;
  }

  return task.run(driver, options);
}
947101
function ( options ) {
			this.protocol = options.protocol || 'http';
			this.port = options.port;
			this.server = options.server;
			this.path = options.path;
			this.proxy = options.proxy;
			this.jar = request.jar(); // create new cookie jar for each instance

			this.debug = options.debug;

			// set up logging
			const winston = require( 'winston' ),
				// file logging
				path = require( 'path' ),
				fs = require( 'fs' ),
				logDir = path.dirname( process.argv[ 1 ] ) + '/log/',
				logFile = logDir + path.basename( process.argv[ 1 ], '.js' ) + '.log',
				// how many tasks (i.e. requests) to run in parallel
				concurrency = options.concurrency || 3;

			this.logger = new ( winston.Logger )();

			// console logging
			if ( this.debug ) {
				this.logger.add( winston.transports.Console, {
					level: 'debug'
				} );
			}

			this.logger.cli();

			if ( fs.existsSync( logDir ) ) {
				this.logger.add( winston.transports.File, {
					colorize: true,
					filename: logFile,
					json: false,
					level: this.debug ? 'debug' : 'info'
				} );
			}

			// requests queue
			// @see https://github.com/caolan/async#queue
			this.queue = async.queue( function ( task, callback ) {
			// process the task (and call the provided callback once it's completed)
				task( callback );
			}, concurrency );

			// HTTP client
			this.formatUrl = require( 'url' ).format;

			this.userAgent = options.userAgent || ( `nodemw/${VERSION} (node.js ${process.version}; ${process.platform} ${process.arch})` );
			this.version = VERSION;

			// debug info
			this.info( process.argv.join( ' ' ) );
			this.info( this.userAgent );

			let port = this.port ? `:${this.port}` : '';

			this.info( `Using <${this.protocol}://${this.server}${port}${this.path}/api.php> as API entry point` );
			this.info( '----' );
		}
199007
function verifyTasks() {
      if ( options.tasks.build ) {
        if ( isTypeString(options.tasks.build) ) {
          options.tasks.build = [options.tasks.build];
        }
        if ( util.isArray(options.tasks.build) ) {
          options.tasks.build.forEach(function( item ) {
            if ( !isTypeString(item) ) {
              errorOption('tasks.build', JSON.stringify(item));
            }
          });
        }
        else {
          errorOption('tasks.build', options.tasks.build);
        }
      }
      else {
        options.tasks.build = [];
      }
    }
139505
function createTask(gulp, options, taskFile){
	var fn;
	var extension = path.extname(taskFile);
	var filename = path.basename(taskFile, extension);
	var task = require(taskFile)(gulp, options.data, loadGulpConfig.util, filename);
	if(Array.isArray(task)){
		fn = isFunction(task[task.length - 1]) ? task.pop() : void(0);
		gulp.task(filename, task, fn);
	}else if(isString(task)){
		gulp.task(filename, [task]);
	}else if(isFunction(task)){
		gulp.task(filename, task);
	}else if(isExotic(task)){
		keys(task).map(mapTaskObject.bind(this, filename, task)).forEach(function(task){
			if(task.cmds){
				if(isFunction(task.fn)){
					gulp.task(task.name, task.cmds, task.fn);
				}else{
					gulp.task(task.name, task.cmds);
				}
			}else{
				gulp.task(task.name, task.fn);
			}
		});
	}
}
1180865
function run (task, runId)
{
	if (task._runId !== runId)
		return;
	
	var delay = Math.max(0, task.nextEvent.getTime() - Date.now());
	task._timeout = setTimeout(executeTask, delay, task, runId);
	if (task._unref)
		task._timeout.unref();
}
1085509
def execute(self, env, args):
        

        task_name = args.task_name

        if not env.task.exists(task_name):
            raise errors.TaskNotFound(task_name)

        if env.task.active and task_name == env.task.name:
            raise errors.ActiveTask

        # open in task config in editor
        task_config = env.task.get_config_path(task_name)

        if not _edit_task_config(env, task_config, confirm=True):
            raise errors.FocusError(u'Could not open task config: {0}'
                                    .format(task_config))
140924
public void launchTask(Task task, String trackerName, InetAddress addr) {
    CoronaSessionInfo info = new CoronaSessionInfo(
      coronaJT.getSessionId(), coronaJT.getJobTrackerAddress(),
      coronaJT.getSecondaryTrackerAddress());
    LaunchTaskAction action = new LaunchTaskAction(task, info);
    String description = "LaunchTaskAction " + action.getTask().getTaskID();
    ActionToSend actionToSend =
        new ActionToSend(trackerName, addr, action, description);
    LOG.info("Queueing " + description +  " to worker " +
      trackerName + "(" + addr.host + ":" + addr.port + ")");
    allWorkQueues.enqueueAction(actionToSend);
  }
661008
public function attach(Task $task, $task_name = null)
    {
        if (is_null($task_name)) {
            $task_name = count($this->tasks);
        }
        $this->tasks[$task_name] = $task;
        curl_multi_add_handle($this->curl, $task->createCurl());
        $deferred = new Deferred();
        $this->deferred[$task_name] = $deferred;

        return $deferred->promise();
    }
1359172
function (methodName, params, execOptions) {
                var requestId = this._getRequestId(methodName, params);
                var promise = this._getRequestPromise(requestId);

                if (!promise) {
                    this._addToBatch(methodName, params);
                    promise = this._createPromise(requestId);
                    this._run(execOptions);
                }

                return promise;
            }
383253
function ( taskName ) {
			var task = grunt.config.get( "bundles" )[taskName];

			var retVal = {};
			if ( task && task.aliases ) {
				var aliases = task.aliases;
				if ( !sys.isEmpty( aliases ) ) {
					grunt.verbose.writeln( "Adding aliases for " + taskName );
					if ( sys.isArray( aliases ) ) {
						sys.each( aliases, function ( map ) {
							map = map || {};

							if ( !sys.isString( map.dest ) ) {map.dest = map.cwd;}
							if ( !sys.isString( map.dest ) ) {return grunt.util.error( "dest or cwd is required" );}

							map.cwd = map.cwd || "";
							map.expand = map.expand !== false;
							var files = grunt.file.expand( map, map.src );
							sys.each( files, function ( item ) {
								var thisPath;
								if ( sys.isEmpty( map.dest ) ) {
									thisPath = item;
								} else {
									thisPath = path.join( map.dest, item );
								}

								var thisAlias = thisPath.replace( /\.[^/.]+$/, "" ).replace( /\\/g, "/" );

								retVal[thisAlias] = resolvePath( path.join( map.cwd, item ) );

							} );
						} );
					} else {
						sys.each( aliases, function ( item, key ) {
							retVal[key] = resolvePath( item );
						} );

					}
				}
			}
			return retVal;
		}
57929
function moduleTask(taskname, depsOrFn, fn, noAutoRegister) {

    var module = this;

    if (typeof(depsOrFn) == 'string') {
      depsOrFn = [depsOrFn];
    }

    if (Array.isArray(depsOrFn)) {

      var map = [];

      depsOrFn.forEach(function (dep) {
        map.push(module.name + '-' + dep);
      });

      depsOrFn = map;

    }

    var fulltaskname = module.name + '-' + taskname;
    gulp.task(fulltaskname, depsOrFn, fn);

    if(!noAutoRegister) {
      module.tasks.push(fulltaskname);
    }

  }
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);
		}
	};
}
812673
function(taskFn, taskParams) {
        var task = this._buildTask(taskFn, taskParams);

        if(task.params.weight > this._params.weightLimit) {
            throw Error('task with weight of ' +
                task.params.weight +
                ' can\'t be performed in queue with limit of ' +
                this._params.weightLimit);
        }

        this._enqueueTask(task);
        this._isStopped || this._scheduleRun();

        task.defer.promise().always(
            function() {
                this._stats.processingTasksCount--;
                this._stats.processedTasksCount++;
            },
            this);

        return task.defer.promise();
    }
246250
async function run(task, action, ...args) {
  const command = process.argv[2]
  const taskName =
    command && !command.startsWith('-') ? `${task} ${command}` : task
  const start = new Date()
  process.stdout.write(`Starting '${taskName}'...\n`)
  try {
    await action(...args)
    process.stdout.write(
      `Finished '${taskName}' after ${new Date().getTime() -
        start.getTime()}ms\n`
    )
  } catch (error) {
    process.stderr.write(`${error.stack}\n`)
  }
}
456570
def invoke_dependencies(*args, options)
      self.dependencies.each do |name|
        if task = self.class[name] # first try if there is a task with given name
          task.call(*args, options) # TODO: what about arguments?
        elsif File.exist?(name) # if not, then fallback to file
          task_will_run?(name)
        else
          raise TaskNotFound, "Task with name #{name} doesn't exist"
        end
      end
    end
115022
public function execute($name, $option = [])
    {
        if (is_string($name)) {
            $names = explode(self::SEPARATOR, $name);
            $method = array_pop($names);
            $task = $this->get($name);
        }

        $task->execute($option);
    }
907474
function TaskRun(target) {
    this.name = target.name || 0;
    this.files = target.files || [];
    this._getConfig = target._getConfig;
    this.options = target.options;
    this.startedAt = false;
    this.spawned = null;
    this.changedFiles = Object.create(null);
    this.spawnTaskFailure = false;
    this.livereloadOnError = true;
    if (typeof this.options.livereloadOnError !== 'undefined') {
      this.livereloadOnError = this.options.livereloadOnError;
    }
  }