import { RetryTaskBase, RetryTaskType } from "./retry-task-base"; import { RetryPolicy } from "./retry/retry-policy"; import * as pb from "../proto/orchestrator_service_pb"; /** * A task that can be retried according to a declarative retry policy. * * @remarks * This class extends RetryTaskBase and adds policy-driven delay computation. * It tracks attempts and computes the next retry delay based on exponential * backoff with the configured retry policy. */ export declare class RetryableTask extends RetryTaskBase { private readonly _retryPolicy; /** * Creates a new RetryableTask instance. * * @param retryPolicy - The retry policy to use for this task * @param action - The orchestrator action associated with this task * @param startTime - The time when the task was first scheduled * @param taskType - The type of task (activity or sub-orchestration) */ constructor(retryPolicy: RetryPolicy, action: pb.OrchestratorAction, startTime: Date, taskType: RetryTaskType); /** * Gets the retry policy for this task. */ get retryPolicy(): RetryPolicy; /** * Computes the next retry delay in milliseconds. * * @param currentTime - The current orchestration time (for deterministic replay) * @returns The delay in milliseconds until the next retry, or undefined if no more retries should be attempted * * @remarks * Returns undefined if: * - The handleFailure predicate returns false for the last failure * - The maximum number of attempts has been reached * - The retry timeout has been exceeded * * The delay is calculated using exponential backoff: * delay = firstRetryInterval * (backoffCoefficient ^ (attemptCount - 1)) * * The delay is capped at maxRetryInterval. */ computeNextDelayInMilliseconds(currentTime: Date): number | undefined; }