DurableClock
Durable timers for workflow sleeps.
make creates a DurableClock with a name, duration, and deferred wake-up signal. sleep ignores zero durations, runs short sleeps through an in-memory activity, and schedules longer sleeps through the WorkflowEngine before awaiting the durable deferred tied to the clock.
Constructors
Delays & Timeouts
Waits inside a workflow, using an in-memory activity for durations at or below the threshold and scheduling a durable clock for longer durations.
Signature
declare const sleep: (options: {
readonly duration: Duration.Input;
readonly inMemoryThreshold?: Duration.Input;
readonly name: string;
}) => Effect.Effect<void, never, WorkflowEngine | WorkflowInstance>;Models
DurableClock interface
Added in v4.0.0
Source
Represents a durable workflow timer with a name, duration, and deferred completed when the timer wakes.
Signature
interface DurableClock {
readonly "~effect/workflow/DurableClock": "~effect/workflow/DurableClock";
readonly deferred: DurableDeferred<Void>;
readonly duration: Duration;
readonly name: string;
}
Creates a durable clock definition and its associated deferred wake-up signal.