promise-util-task
Version:
task manager for promise
20 lines (19 loc) • 854 B
TypeScript
/**
* It will always be executed in the order waiting for the result of Promise.
* @param funcs An array of functions that return value, or promise.
* @returns Results are stored in the order stored in funcs.
*/
export declare const seq: (funcs: (() => any)[]) => Promise<any[]>;
/**
* Execute processing at once.
* @param funcs An array of functions that return value, or promise.
* @returns Results are stored in the order stored in funcs.
*/
export declare const all: (funcs: (() => any)[]) => Promise<any[]>;
/**
* Execute the specified number of processes at once.
* @param funcs An array of functions that return value, or promise.
* @param max Maximum number of simultaneous executions.
* @returns Results are stored in the order stored in funcs.
*/
export declare const limit: (funcs: (() => any)[], max?: number) => Promise<any[]>;