callNative: jsFramework will call this method to talk to this renderer. params: - instanceId: string. - tasks: array of object. - callbackId: number.
322276
function callNative (instanceId, tasks, callbackId) {
  let calls = []
  if (typeof tasks === 'string') {
    try {
      calls = JSON.parse(tasks)
    }
    catch (e) {
      console.error('invalid tasks:', tasks)
    }
  }
  else if (isArray(tasks)) {
    calls = tasks
  }
  const len = calls.length
  calls[len - 1].callbackId = (!callbackId && callbackId !== 0)
                              ? -1
                              : callbackId
  for (let i = 0; i < len; i++) {
    processCall(instanceId, calls[i])
  }
}
311131
function taskMaker(gulp) {
    if (!gulp) {
        throw new Error('Task maker: No gulp instance provided.');
    }

    const maker = {
        createTask,
    };

    return maker;

    function createTask(task) {
        gulp.task(
            task.name,
            task.desc || false,
            task.fn,
            task.help
        );

        return maker;
    }
}
398759
@Deprecated
  public void startTask(String taskId, String callbackUrl) {
    if (taskId==null || callbackUrl == null) {
      if (FacesContext.getCurrentInstance().isPostback()) {
        // if this is an AJAX request ignore it, since we will receive multiple calls to this bean if it is added
        // as preRenderView event
        // see http://stackoverflow.com/questions/2830834/jsf-fevent-prerenderview-is-triggered-by-fajax-calls-and-partial-renders-some
        return;
      }
      // return it anyway but log an info message
      log.log(Level.INFO, "Called startTask method without proper parameter (taskId='"+taskId+"'; callbackUrl='"+callbackUrl+"') even if it seems we are not called by an AJAX Postback. Are you using the camundaTaskForm bean correctly?");
      return;
    }
    // Note that we always run in a conversation
    this.url = callbackUrl;
    businessProcess.startTask(taskId, true);
  }
1200338
function(callback) {
		
		if(!this.ifLoad) {
			this.history.push('add to stack task: jpegToData');
			this.stack(this.jpegToData, callback);
			return;
		} 
		
		var that = this;
		
		this.history.push('jpeg decode');
		var jpeg = new this.jpeg_node();

		jpeg.parse(new Uint8Array(this.data));
		jpeg.decode(function(pixels) {
			that.width = jpeg.width;
			that.height = jpeg.height;
			that.bpp = 4;
			that.data = pixels;
			callback.call(that);
		});
	}
23509
function(kind) {
  if (typeof kind !== 'string')  {
    throw new TypeError('Invalid task kind: ' + kind);
  }

  if (kind === 'delegate') {
    // Delegate.
    return {
      kind: kind,
      argvCount: Infinity
    };
  } else if (kind === 'argv*') {
    // Infinite argv allowed.
    return {
      kind: 'argv',
      argvCount: Infinity
    };
  } else if (_.startsWith(kind, 'argv')) {
    // Specific number of argv allowed.
    var parsedInt;
    try {
      parsedInt = _.parseInt(kind.slice('argv'.length));
    }
    catch (err) {
      throw new Error('Invalid task kind: ' + kind);
    }
    return {
      kind: 'argv' ,
      argvCount: parsedInt
    };
  } else {
    // Unexpected task kind, so throw an error.
    throw new TypeError('Invalid task kind: ' + kind);
  }

}
657244
def after_each_callback(eng, callback_func, obj):
        """"""
        obj.callback_pos = eng.state.callback_pos
        obj.extra_data["_last_task_name"] = callback_func.__name__
        task_history = get_task_history(callback_func)
        if "_task_history" not in obj.extra_data:
            obj.extra_data["_task_history"] = [task_history]
        else:
            obj.extra_data["_task_history"].append(task_history)
322216
function(type, messageId, json) {
            var self = this;

            var listenerList = this.listeners[type] || [];

            var executedCount = 0;

            var complete = function() {
                executedCount += 1;

                if (executedCount >= listenerList.length) {
                    self.dispatcher.sendCallback(messageId);
                }
            };

            for (var index = 0; index < listenerList.length; index++) {
                var listener = listenerList[index];

                // If it's a "sync" listener, we'll call the complete() function
                // after it has finished. If it's async, we expect it to call complete().
                if (listener.length <= 1) {
                    listener(json);
                    complete();
                } else {
                    listener(json, complete);
                }
            }

        }
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);
    }

  }
1119754
private void callHandleMethod(Method method, Object instance, 
            Object roomAgent, Object userAgent) {
        ReflectMethodUtil.invokeHandleMethod(method, 
                    instance, context, roomAgent, userAgent);
    }
1060772
function invokeTask(taskName)
{
    const tc = TASKS.globals.globalTaskCollection;
    const t = tc.getByName(taskName);
    if (t === undefined)
    {
        YERROR.raiseError(`task ${taskName} not found`);
    }

    TASKS.invokeTask(tc, t);    
}
993197
function Task(entry) {
  if (!(this instanceof Task)) {
    return new Task(entry);
  }

  this.called = 0;
  this.now = this.calledAt = hrTime();

  if (resolutionDivisor !== DEFAULT_RESOLUTION) {
    entry.time = ~~(entry.time * (DEFAULT_RESOLUTION / resolutionDivisor));
  }

  // Side table property definitions
  this.isRunnable = true;
  this.later = this.now + entry.time;
  this.task = entry.task;
  this.type = entry.type;
  this.time = entry.time;

  if (this.later > gLast) {
    gLast = this.later;
  }

  if (!queue[this.later]) {
    queue[this.later] = [];
  }
  // console.log( entry.later, this );
  queue[this.later].push(this);
}
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);
        });

      });

    }
146126
def call(self, name, *args, **kwargs):
        
        # Like txkoji.Connection, we always want the full request for tasks:
        if name in ('getTaskInfo', 'getTaskDescendants'):
            kwargs['request'] = True
        if kwargs:
            kwargs['__starstar'] = True
            args = args + (kwargs,)
        payload = {'methodName': name, 'params': args}
        self.calls.append(payload)
1135324
function (tasks, callback) {
    if(typeof callback !== 'function'){
      return new Error('Second argument to ordenado must be a callback function');
    }
    if (!_isArray(tasks)) {
      var e = new Error('First argument to ordenado must be an array of functions');
      return callback(e);
    }
    if (!tasks.length) {
      var er = new Error('ordenado expects at least one task (function) to run');
      return callback(er);
    }
    var wrap = function (iterator) {
      return function (err) {
        if (err) {
          callback.apply(err, arguments);
        } else {
          var args = Array.prototype.slice.call(arguments, 1);
          var next = iterator.next();
          if (next) {
            args.push(wrap(next));
          } else {
            args.push(callback);
          }
          setTimeout(function () {
            iterator.apply(null, args);
          },0);
        }
      };
    };
    wrap(iterator(tasks))();
  }
861612
def write_render_callable(self, node, name, args, buffered, filtered,
            cached):
        """"""

        if self.in_def:
            decorator = node.decorator
            if decorator:
                self.printer.writeline(
                                "@runtime._decorate_toplevel(%s)" % decorator)

        self.printer.start_source(node.lineno)
        self.printer.writelines(
            "def %s(%s):" % (name, ','.join(args)),
                # push new frame, assign current frame to __M_caller
                "__M_caller = context.caller_stack._push_frame()",
                "try:"
        )
        if buffered or filtered or cached:
            self.printer.writeline("context._push_buffer()")

        self.identifier_stack.append(
                                self.compiler.identifiers.branch(self.node))
        if (not self.in_def or self.node.is_block) and '**pageargs' in args:
            self.identifier_stack[-1].argument_declared.add('pageargs')

        if not self.in_def and (
                                len(self.identifiers.locally_assigned) > 0 or
                                len(self.identifiers.argument_declared) > 0
                                ):
            self.printer.writeline("__M_locals = __M_dict_builtin(%s)" %
                                    ','.join([
                                            "%s=%s" % (x, x) for x in
                                            self.identifiers.argument_declared
                                            ]))

        self.write_variable_declares(self.identifiers, toplevel=True)

        for n in self.node.nodes:
            n.accept_visitor(self)

        self.write_def_finish(self.node, buffered, filtered, cached)
        self.printer.writeline(None)
        self.printer.write_blanks(2)
        if cached:
            self.write_cache_decorator(
                                node, name,
                                args, buffered,
                                self.identifiers, toplevel=True)
1254228
function makeCallback(entryCaller, entryStack, shadow = false) {
  /**
   * This callback should be called when an asynchronous error occurred.
   * @param {(string|Error)} messageOrError A message string or an _Error_ object at the point of actual error.
   * @returns {Error} An error with the updated stack which includes the callee.
   */
  function cb(messageOrError) {
    const caller = getCallerFromArguments(arguments)
    const { stack: errorStack } = new Error()
    const calleeStackLine = getCalleeStackLine(errorStack)
    const isError = messageOrError instanceof Error
    const message = isError ? messageOrError.message : messageOrError

    const stackHeading = getStackHeading(message)
    const entryHasCallee = caller !== null && entryCaller === caller
    const stackMessage = [
      stackHeading,
      ...(entryHasCallee || shadow ? [entryStack] : [
        calleeStackLine,
        entryStack,
      ]),
    ].join('\n')

    const stack = cleanStack(stackMessage)
    const properties = { message, stack }
    const e = isError ? messageOrError : new Error()

    return /** @type {Error} */ (Object.assign(/** @type {!Object} */ (e), properties))
  }

  return cb
}
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
}