from CommonsChunkPlugin (async methods):
428081
function moveExtractedChunkBlocksToTargetChunk(chunks, targetChunk) {
  chunks.forEach(chunk => {
    if (chunk === targetChunk) {
      return
    }
    chunk.blocks.forEach(block => {
      // https://github.com/webpack/webpack/commit/7834e6cd570317d3e81c613b98c60defc85c1001
      if (block.chunks.indexOf(targetChunk) === -1) {
        block.chunks.unshift(targetChunk)
      }
      targetChunk.addBlock(block)
    })
  })
}
938546
function (callback) {
            async.map([ "unk.dat.gz", "unk_pos.dat.gz", "unk_map.dat.gz", "unk_char.dat.gz", "unk_compat.dat.gz", "unk_invoke.dat.gz" ], function (filename, _callback) {
                loadArrayBuffer(path.join(dic_path, filename), function (err, buffer) {
                    if(err) {
                        return _callback(err);
                    }
                    _callback(null, buffer);
                });
            }, function (err, buffers) {
                if(err) {
                    return callback(err);
                }
                var unk_buffer = new Uint8Array(buffers[0]);
                var unk_pos_buffer = new Uint8Array(buffers[1]);
                var unk_map_buffer = new Uint8Array(buffers[2]);
                var cat_map_buffer = new Uint8Array(buffers[3]);
                var compat_cat_map_buffer = new Uint32Array(buffers[4]);
                var invoke_def_buffer = new Uint8Array(buffers[5]);

                dic.loadUnknownDictionaries(unk_buffer, unk_pos_buffer, unk_map_buffer, cat_map_buffer, compat_cat_map_buffer, invoke_def_buffer);
                // dic.loadUnknownDictionaries(char_buffer, unk_buffer);
                callback(null);
            });
        }
1194053
@Override
    public YourFuture async(ConcurrentAsyncCall noArgLambda) {
        assertThreadCallbackNotNull(noArgLambda);
        assertExecutorServiceValid();
        if (noArgLambda.asPrimary()) { // forcing option
            return doAsyncPrimary(noArgLambda);
        } else {
            final ConcurrentAsyncImportance importance = noArgLambda.importance();
            if (importance != null) {
                if (ConcurrentAsyncImportance.PRIMARY.equals(importance)) {
                    return doAsyncPrimary(noArgLambda);
                } else if (ConcurrentAsyncImportance.SECONDARY.equals(importance)) {
                    return doAsyncSecondary(noArgLambda);
                } else if (ConcurrentAsyncImportance.TERTIARY.equals(importance)) {
                    return doAsyncTertiary(noArgLambda);
                } else { // no way
                    throw new IllegalStateException("Unknown importance: " + importance);
                }
            } else {
                return doAsyncSecondary(noArgLambda); // as default
            }
        }
    }
1332742
async function() {
    const oThis = this
    ;

    await new openSTStorage.TokenBalanceModel({
      ddb_service: ddbServiceObj,
      auto_scaling: autoScalingServiceObj,
      erc20_contract_address: oThis.erc20
    }).allocate();
  }
138128
function(callback) {
    const contentStream = new stream.Writable();
    const data = [];

    contentStream._write = function(chunk) {
      callback(null, chunk.toString());
    };


    // here we can add the options in the future:
    // (options, context, gitRawCommitsOpts, parserOpts, writerOpts);
    const options = {
      preset: program.changelogpreset,
      releaseCount: program.releasecount,
    };
    changelog(options)
    // Use through() to handle multiple chunks which could be returned from changelog()
        .pipe(through({
          objectMode: true,
        }, function(chunk, enc, cb) {
          try {
            data.push(chunk);
          } catch (err) {
            setImmediate(function() {
              throw err;
            });
          }

          cb();
        }, function(cb) {
        // This function is called once ALL the object-chunks have been processed.
          data.push(null);

          cb(null, data.join('')); // Pass the data to the next stream processor
        }))
        .pipe(contentStream);
  }
733525
public void writeAsyncHeader(@NotNull Wire wire, String csp, long cid) {
        assert outBytesLock().isHeldByCurrentThread();

        wire.writeDocument(true, wireOut -> {
            if (cid == 0)
                wireOut.writeEventName(CoreFields.csp).text(csp);
            else
                wireOut.writeEventName(CoreFields.cid).int64(cid);
        });
    }
683236
synchronized Plugin nextPlugin() {
    	if (!init) {
    		this.reset();
    	}
    	
        Plugin plugin = probeNextPlugin();
        if (plugin == null) {
            return null;
        }
        
        listPending.remove(plugin);
        plugin.setTimeStarted();
        listRunning.add(plugin);

        return plugin;
    }
105041
function readChunk(path, start, end, callback) {
  if (end < 0) {
    return readLastChunk(path, start, end, callback);
  }
  var stream = nodeFs.createReadStream(path, {
    start: start,
    end: end - 1
  });
  var chunks = [];
  stream.on("readable", function () {
    var chunk = stream.read();
    if (chunk === null) return callback(null, Buffer.concat(chunks));
    return chunks.push(chunk);
  });
  stream.on("error", function (err) {
    if (err.code === "ENOENT") return callback();
    return callback(err);
  });
}
751677
function blockSync(name = '', skip = 0) {
	const
		baseRoot = path.join(sourceDirs[0], config.blockDir);

	if (!name) {
		return baseRoot;
	}

	const
		baseExt = path.extname(name),
		advExt = baseExt ? '' : 'index.js';

	let
		r = sourceDirs,
		ctx;

	if (Sugar.Object.isString(skip)) {
		ctx = skip;
		skip = 0;
	}

	if (config.superRgxp.test(name)) {
		if (!ctx) {
			throw Error('Context for block is not defined');
		}

		name = name.replace(config.superRgxp, '');
		r = r.slice(1);

		for (let i = 0; i < r.length; i++) {
			if (isPathInside(ctx, r[i])) {
				r = r.slice(i + 1);
				break;
			}
		}
	}

	const
		wrap = (path, lvl) => skip ? {path, from: lvl + 1} : path;

	for (let i = skip; i < r.length; i++) {
		if (i && baseExt && ignore[i - 1].has(baseExt)) {
			continue;
		}

		const
			root = r[i],
			file = path.join(name, advExt).replace(/\.logic$/, `.${types[i]}`);

		if (!glob.hasMagic(file) && fs.existsSync(path.join(root, file))) {
			return wrap(path.join(root, baseExt ? file : name), i);
		}

		const
			components = `/**/${file}`,
			virtualComponents = !baseExt && `/**/${name}.index.js`;

		let
			src = glob.sync(path.join(root, components))[0];

		if (!src && virtualComponents) {
			src = glob.sync(path.join(root, virtualComponents))[0];
		}

		if (src) {
			return wrap(advExt ? path.dirname(src) : src, i);
		}
	}

	return baseExt || skip ? null : path.join(baseRoot, name);
}
342572
function extractOriginsOfChunkWithExtractedModules(chunk, reason = 'async commons') {
  return chunk.origins.map((origins, origin) => Object.assign({}, origin, {
    reasons: (origin.reasons || []).concat(reason)
  }))
}
289552
function hotDownloadUpdateChunk(chunkId) {
		var filename = require("path").join(__dirname, $hotChunkFilename$);
		require("fs").readFile(filename, "utf-8", function(err, content) {
			if (err) {
				if ($require$.onError) return $require$.oe(err);
				throw err;
			}
			var chunk = {};
			require("vm").runInThisContext(
				"(function(exports) {" + content + "\n})",
				{ filename: filename }
			)(chunk);
			hotAddUpdateChunk(chunk.id, chunk.modules);
		});
	}
1197250
private ByteBuffer getChunk(final int chunkIdx) throws IOException, InterruptedException {
        ByteBuffer chunk = chunkCache[chunkIdx];
        if (chunk == null) {
            final ByteBuffer byteBufferDup = zipFileSlice.physicalZipFile.getByteBuffer(chunkIdx).duplicate();
            chunk = chunkCache[chunkIdx] = byteBufferDup;
        }
        return chunk;
    }
1285210
private static ChunkOutput writeChunkOutput(
      Compiler compiler, Flags flags, List<JSModule> chunks) {
    ArrayList<File> outputFiles = new ArrayList<>();
    ChunkOutput output = new ChunkOutput();

    Map<String, String> parsedModuleWrappers =
        parseModuleWrappers(Arrays.asList(getStringArray(flags, "chunkWrapper")), chunks);

    for (JSModule c : chunks) {
      if (flags.createSourceMap != null && !flags.createSourceMap.equals(false)) {
        compiler.resetAndIntitializeSourceMap();
      }

      File file = new File();
      file.path = flags.chunkOutputPathPrefix + c.getName() + ".js";

      String code = compiler.toSource(c);

      int lastSeparatorIndex = file.path.lastIndexOf('/');
      if (lastSeparatorIndex < 0) {
        lastSeparatorIndex = file.path.lastIndexOf('\\');
      }
      String baseName = file.path.substring(Math.max(0, lastSeparatorIndex));
      String wrapper = parsedModuleWrappers.get(c.getName()).replace("%basename%", baseName);
      StringBuilder out = new StringBuilder();
      int pos = wrapper.indexOf("%s");
      if (pos != -1) {
        String prefix = "";

        if (pos > 0) {
          prefix = wrapper.substring(0, pos);
          out.append(prefix);
        }

        out.append(code);

        int suffixStart = pos + "%s".length();
        if (suffixStart != wrapper.length()) {
          // Something after placeholder?
          out.append(wrapper, suffixStart, wrapper.length());
        }
        // Make sure we always end output with a line feed.
        out.append('\n');

        // If we have a source map, adjust its offsets to match
        // the code WITHIN the wrapper.
        if (compiler != null && compiler.getSourceMap() != null) {
          compiler.getSourceMap().setWrapperPrefix(prefix);
        }

      } else {
        out.append(code);
        out.append('\n');
      }

      file.src = out.toString();

      if (flags.createSourceMap != null && !flags.createSourceMap.equals(false)) {
        StringBuilder b = new StringBuilder();
        try {
          compiler.getSourceMap().appendTo(b, file.path);
        } catch (IOException e) {
          // ignore
        }
        file.sourceMap = b.toString();
      }
      outputFiles.add(file);
    }

    output.compiledFiles = outputFiles.toArray(new File[0]);
    return output;
  }
663724
function prepareResources(output) {
    var plugins = output.getPlugins();
    var options = output.getOptions();
    var type    = options.get('prefix');
    var state   = output.getState();
    var context = Api.encodeGlobal(output);

    var result = Immutable.Map();

    return Promise.forEach(plugins, function(plugin) {
        var pluginResources = plugin.getResources(type);

        return Promise()
        .then(function() {
            // Apply resources if is a function
            if (is.fn(pluginResources)) {
                return Promise()
                .then(pluginResources.bind(context));
            }
            else {
                return pluginResources;
            }
        })
        .then(function(resources) {
            result = result.set(plugin.getName(), Immutable.Map(resources));
        });
    })
    .then(function() {
        // Set output resources
        state = state.merge({
            resources: result
        });

        output = output.merge({
            state: state
        });

        return output;
    });
}
738542
function(id, responseParser) {
            var lastChunkIdx = handler._getTotalChunks(id) - 1,
                xhr = handler._getXhr(id, lastChunkIdx);

            if (responseParser) {
                return new qq.Promise().success(responseParser(xhr), xhr);
            }

            return new qq.Promise().success({}, xhr);
        }
600579
function(onProgress) {
        onProgress = onProgress || function() {};
        let projects = library.public_getters.getProjects();
        library.autosave(false);
        return promiseUtils.chain(downloadChunks, function(err, data) {
            if(err instanceof Error) return Promise.reject(err);
            console.log(err);
            return false;
        }, {compact: true, onProgress: onProgress.bind(null, 'chunks')})(projects)
            .then(function() {
                library.commit();
                library.autosave(true);
                return Promise.resolve();
            })
            .catch(function(err) {
                library.autosave(true);
                return Promise.reject(err);
            });
    }
479431
function PancakesHapiPlugin(opts) {
    this.pancakes   = opts.pluginOptions.pancakes;
    this.jangular   = opts.pluginOptions.jangular;
}