@newdash/newdash
Version:
javascript/typescript utility library
24 lines (23 loc) • 667 B
TypeScript
import { AsyncFunction } from "../types";
/**
* limit concurrent for parallel operations
*
* @category Async
* @since 5.15.0
* @param runner async operation function
* @param concurrencyNumber max concurrency number
*
* @returns the concurrency limited function wrapper
*
*/
export declare function limit<T extends AsyncFunction>(runner: T, concurrencyNumber: number): T;
/**
* let async function only invoke at once in same time
*
* @category Async
* @since 5.20.0
* @param func the function to be processed
* @returns the wrapped function instance
*/
export declare function synchronized<T extends AsyncFunction>(func: T): T;
export default limit;