MCPcopy Create free account
hub / github.com/Effect-TS/effect / repeatForever

Function repeatForever

packages/effect/src/internal/schedule.ts:1277–1292  ·  view source on GitHub ↗
(self: Schedule.Schedule<Out, In, Env>)

Source from the content-addressed store, hash-verified

1275
1276/** @internal */
1277export const repeatForever = <Env, In, Out>(self: Schedule.Schedule<Out, In, Env>): Schedule.Schedule<Out, In, Env> =>
1278 makeWithState(self.initial, (now, input, state) => {
1279 const step = (
1280 now: number,
1281 input: In,
1282 state: any
1283 ): Effect.Effect<[any, Out, ScheduleDecision.ScheduleDecision], never, Env> =>
1284 core.flatMap(
1285 self.step(now, input, state),
1286 ([state, out, decision]) =>
1287 ScheduleDecision.isDone(decision)
1288 ? step(now, input, self.initial)
1289 : core.succeed([state, out, decision])
1290 )
1291 return step(now, input, state)
1292 })
1293
1294/** @internal */
1295export const repetitions = <Out, In, R>(self: Schedule.Schedule<Out, In, R>): Schedule.Schedule<number, In, R> =>

Callers

nothing calls this directly

Calls 2

makeWithStateFunction · 0.85
stepFunction · 0.70

Tested by

no test coverage detected