Hyperlinkv0.8.0-beta.28

Schedule

Schedule.foreverconsteffect/Schedule.ts:2130
Schedule<number, unknown, never, never>

Returns a new Schedule that will recur forever.

Details

The output of the schedule is the current count of its repetitions thus far (i.e. 0, 1, 2, ...).

Example (Repeating forever)

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

// A schedule that runs forever with no delay
const infiniteSchedule = Schedule.forever

const program = Effect.gen(function*() {
  yield* Effect.repeat(
    Effect.gen(function*() {
      yield* Console.log("Running forever...")
      return "continuous-task"
    }),
    infiniteSchedule.pipe(Schedule.upTo({ times: 5 })) // Limit for demo
  )
})
constructors
export const forever: Schedule<number> = spaced(Duration.zero)
Referenced by 2 symbols