UNPKG

github-pr-automation

Version:

MCP server and CLI for automated GitHub PR management, review resolution, and workflow optimization

79 lines 2.67 kB
/** * 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<T> { key: string; fn: () => Promise<T>; priority: "high" | "normal" | "low"; } export interface BatchResult<T> { 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<T>(requests: BatchRequest<T>[]): Promise<BatchResult<T>[]>; /** * 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<BatchResult<unknown>[]>; /** * 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<BatchResult<unknown>[]>; /** * 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<BatchResult<unknown>[]>; } /** * 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