Skip to content

Latest commit

 

History

History
70 lines (40 loc) · 1.11 KB

File metadata and controls

70 lines (40 loc) · 1.11 KB

Home > @aws/durable-execution-sdk-js > DurableContext > wait

DurableContext.wait() method

Pauses execution for the specified duration

Signature:

wait(name: string, duration: Duration): DurablePromise<void>;

Parameters

Parameter

Type

Description

name

string

Step name for tracking and debugging

duration

Duration

Duration to wait

Returns:

DurablePromise<void>

Example

// Wait 5 seconds before retrying
await context.wait("retry-delay", { seconds: 5 });

// Wait for a longer duration
await context.wait("long-delay", { minutes: 5, seconds: 30 });