/** * Parallel request handling for GitHub API * * Batches related API calls to improve performance and reduce * the number of round trips to GitHub's API. */ import type { GitHubClient } from "./client.js"; export interface BatchRequest { key: string; fn: () => Promise; priority: "high" | "normal" | "low"; } export interface BatchResult { key: string; data?: T; error?: Error; } /** * Handles parallel GitHub API requests with concurrency control * * Manages batching and parallel execution of GitHub API calls * to improve performance while respecting rate limits. */ export declare class ParallelRequestHandler { private client; private maxConcurrency; /** * Create a new parallel request handler * @param client - GitHub client instance * @param maxConcurrency - Maximum concurrent requests (default: 5) */ constructor(client: GitHubClient, maxConcurrency?: number); /** * Execute multiple requests in parallel with concurrency control * @param requests - Array of batch requests to execute * @returns Promise resolving to array of batch results */ executeBatch(requests: BatchRequest[]): Promise[]>; /** * Execute a single request * @param request - Batch request to execute * @returns Promise resolving to batch result */ private executeRequest; /** * Batch PR metadata requests * @param prs - Array of PR identifiers * @returns Promise resolving to array of batch results */ batchPRMetadata(prs: string[]): Promise[]>; /** * Batch check runs requests * @param commits - Array of commit objects with owner, repo, and sha * @returns Promise resolving to array of batch results */ batchCheckRuns(commits: Array<{ owner: string; repo: string; sha: string; }>): Promise[]>; /** * Batch comment requests * @param prs - Array of PR objects with owner, repo, and number * @returns Promise resolving to array of batch results */ batchComments(prs: Array<{ owner: string; repo: string; number: number; }>): Promise[]>; } /** * Create a parallel request handler for a GitHub client * @param client - GitHub client instance * @param maxConcurrency - Maximum concurrent requests (default: 5) * @returns New parallel request handler instance */ export declare function createParallelHandler(client: GitHubClient, maxConcurrency?: number): ParallelRequestHandler; //# sourceMappingURL=parallel-requests.d.ts.map