effect-io-ai

Package: effect
Module: Schedule

Schedule.duration

Returns a schedule that recurs once after the specified duration.

When to use

Use when you need a schedule that recurs once after a fixed delay.

Details

The schedule outputs the configured duration for its first recurrence and then completes.

Example (Recurring once after a duration)

import { Console, Effect, Schedule } from "effect"

const program = Effect.repeat(
  Console.log("runs again after one second"),
  Schedule.duration("1 second")
)

See

Signature

declare const duration: (durationInput: Duration.Input) => Schedule<Duration.Duration>

Source

Since v2.0.0