Transformer which either immediately invokes `all` when everything has finished loading or queues the arguments.
4239
function transformer(tree, file, next) {
    if (loadError) {
      next(loadError)
    } else if (config.checker) {
      all(tree, file, config)
      next()
    } else {
      queue.push([tree, file, config, next])
    }
  }
864922
private void loadAllWithAsyncLoader(final CacheOperationCompletionListener _listener, final Set<K> _keysToLoad) {
    final AtomicInteger _countDown = new AtomicInteger(_keysToLoad.size());
    EntryAction.ActionCompletedCallback cb = new EntryAction.ActionCompletedCallback() {
      @Override
      public void entryActionCompleted(final EntryAction ea) {
        int v = _countDown.decrementAndGet();
        if (v == 0) {
          _listener.onCompleted();
          return;
        }
      }
    };
    for (K k : _keysToLoad) {
      final K key = k;
      executeAsync(key, null, SPEC.GET, cb);
    }
  }
580847
public void execute(TransformerImpl transformer) throws TransformerException
  {

    transformer.pushCurrentTemplateRuleIsNull(true);    
    try
    {
      transformSelectedNodes(transformer);
    }
    finally
    {
      transformer.popCurrentTemplateRuleIsNull();
    }
  }
637359
function all({series, concurrent = 1, delay = 0}) {
  const promises = series.slice();
  const concurrency = concurrent;
  let results = null;

  return new Promise((resolve, reject) => {
    function next(result) {
      const concurrentPromises = [];

      if (!results) {
        results = [];
      } else {
        results = results.concat(result);
      }

      if (promises.length) {
        while (concurrentPromises.length < concurrency && promises.length) {
          let promise = promises.shift();

          if (typeof promise === 'function') {
            promise = promise();
          }

          if (!promise || typeof promise.then !== 'function') {
            promise = Promise.resolve(promise);
          }

          concurrentPromises.push(promise);
        }

        setTimeout(() => {
          Promise.all(concurrentPromises)
          /* eslint-disable promise/no-callback-in-promise */
            .then(next)
            .catch(reject);
        }, delay);
      } else {
        resolve(results);
      }
    }

    next();
  });
}
1170880
def deferred_cleanup(fn):
    """"""
    @functools.wraps(fn)
    def ret(*args, **kwargs):
        defers = []
        try:
            ret = fn(lambda *args: defers.extend(args), *args, **kwargs)
        finally:
            for defer in reversed(defers):
                defer()
        return ret
    return ret
248153
def observe_all(self, callback: Callable[[str, Any, Any], None]):
        """"""
        self._all_callbacks.append(callback)
885381
private static void waitForAll(Iterable<? extends Future<?>> futures) throws InterruptedException, ExecutionException {
		for(Future<?> future : futures) {
			future.get();
		}
	}
1170051
def as_completed(jobs):
  '''  '''

  jobs = tuple(jobs)
  event = threading.Event()
  callback = lambda f, ev: event.set()
  [job.add_listener(Job.SUCCESS, callback, once=True) for job in jobs]
  [job.add_listener(Job.ERROR, callback, once=True) for job in jobs]

  while jobs:
    event.wait()
    event.clear()

    jobs, finished = split_list_by(jobs, lambda x: x.finished)
    for job in finished:
      yield job
753399
def after(self, context):
        ""
        self._invoke(self._after, context)
        run.after_each.execute(context)
283564
def start(**kwargs):
  '''  '''

  output, err = cli_syncthing_adapter.start(**kwargs)
  click.echo("%s" % output, err=err)
888075
def all(self, timeout=None, max_concurrency=64, auto_batch=True):
        
        return self.fanout('all', timeout=timeout,
                           max_concurrency=max_concurrency,
                           auto_batch=auto_batch)
1284986
function asyncBatch (
  renderer,
  pushable,
  resolve,
  reject
) {
  const pull = pullBatch(renderer, pushable);

  pull.then(result => {
    if (result === EXHAUSTED) {
      resolve();
    } else {
      setImmediate(
        asyncBatch,
        renderer,
        pushable,
        resolve,
        reject,
      );
    }
  }).catch(err => {
    reject(err);
  });
}
957640
async def amerge(*agens) -> AsyncGenerator[Any, None]:
    """"""
    xs = stream.merge(*agens)
    async with xs.stream() as streamer:
        async for x in streamer:
            yield x
1236849
function callAll(...fns) {
  return (event, ...args) => fns.some(fn => {
    fn && fn(event, ...args);

    return event.defaultPrevented;
  });
}
661513
def compose_all(stream, Loader=Loader):
    
    loader = Loader(stream)
    try:
        while loader.check_node():
            yield loader.get_node()
    finally:
        loader.dispose()
875479
def load_all(stream):
    
    loader = YAMLDictLoader(stream)
    try:
        while loader.check_data():
            yield loader.get_data()
    finally:
        loader.dispose()
241288
private Process executeToAstProcess(String argument) throws IOException {
        try {
            Process p = new ProcessBuilder("python", codeGenBinDirectory + "/jp-to-ast.py", argument).start();
            p.waitFor();
            return p;
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new RuntimeException(e);
        }
    }