dnsweeper
Version:
Advanced CLI tool for DNS record risk analysis and cleanup. Features CSV import for Cloudflare/Route53, automated risk assessment, and parallel DNS validation.
48 lines • 1.5 kB
TypeScript
/**
* 並列実行制御ユーティリティ
*/
export interface ConcurrentOptions {
concurrency?: number;
onProgress?: (completed: number, total: number) => void;
}
/**
* 複数のPromiseを並列実行数を制限して実行
*/
export declare function runConcurrent<T>(tasks: (() => Promise<T>)[], options?: ConcurrentOptions): Promise<T[]>;
/**
* 配列の要素に対して並列処理を実行
*/
export declare function mapConcurrent<T, R>(items: T[], mapper: (item: T, index: number) => Promise<R>, options?: ConcurrentOptions): Promise<R[]>;
/**
* 並列処理の進捗を追跡するクラス
*/
export declare class ProgressTracker {
private total;
private onUpdate?;
private completed;
private startTime;
constructor(total: number, onUpdate?: (progress: ProgressInfo) => void);
increment(): void;
getProgress(): ProgressInfo;
}
export interface ProgressInfo {
completed: number;
total: number;
percentage: number;
elapsed: number;
rate: number;
eta: number;
remaining: number;
}
/**
* バッチ処理ユーティリティ
*/
export declare function processBatch<T, R>(items: T[], batchSize: number, processor: (batch: T[]) => Promise<R[]>): Promise<R[]>;
/**
* リトライ付き並列実行
*/
export declare function runConcurrentWithRetry<T>(tasks: (() => Promise<T>)[], options?: ConcurrentOptions & {
maxRetries?: number;
retryDelay?: number;
}): Promise<T[]>;
//# sourceMappingURL=concurrent.d.ts.map