import * as pb from "../proto/orchestrator_service_pb"; import { OrchestrationContext } from "./context/orchestration-context"; import { RetryTaskBase, RetryTaskType } from "./retry-task-base"; import { AsyncRetryHandler, RetryHandlerResult } from "./retry/retry-handler"; /** * A task that uses an AsyncRetryHandler for imperative retry control. * * @remarks * Unlike RetryableTask which uses a declarative RetryPolicy, this task delegates * all retry decisions to a user-provided handler function. The handler receives * a RetryContext with failure details, attempt count, and elapsed time, and * returns true to retry or false to stop. * * This mirrors the .NET SDK's InvokeWithCustomRetryHandler pattern, where the * retry handler runs as orchestrator code (subject to replay). */ export declare class RetryHandlerTask extends RetryTaskBase { private readonly _handler; private readonly _orchestrationContext; /** * Creates a new RetryHandlerTask instance. * * @param handler - The async retry handler for imperative retry decisions * @param orchestrationContext - The orchestration context for the current execution * @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(handler: AsyncRetryHandler, orchestrationContext: OrchestrationContext, action: pb.OrchestratorAction, startTime: Date, taskType: RetryTaskType); /** * Gets the async retry handler for this task. */ get handler(): AsyncRetryHandler; /** * Invokes the async retry handler to determine whether to retry. * * @param currentTime - The current orchestration time (for deterministic replay) * @returns A Promise that resolves to `true` to retry immediately, * `false` to stop retrying, or a positive number indicating the * delay in milliseconds before the next retry attempt */ shouldRetry(currentTime: Date): Promise; }