UNPKG

npaw-plugin-nwf

Version:
36 lines (35 loc) 884 B
export interface RetryDecision { shouldRetry: boolean; delay: number; } /** * Manages retry logic with configurable max retries and delays */ export default class RetryPolicy { private retryCounter; private maxRetries; private retryDelay; constructor(maxRetries?: number, retryDelay?: number); /** * Decide whether to retry a failed request * @param requestDescription - Description of the request for logging * @returns Retry decision with delay */ shouldRetry(requestDescription: string): RetryDecision; /** * Reset retry counter (call after successful request) */ reset(): void; /** * Get current retry count */ getRetryCount(): number; /** * Get max retries */ getMaxRetries(): number; /** * Set max retries */ setMaxRetries(maxRetries: number): void; }