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

Function duration

packages/effect/src/internal/schedule.ts:677–692  ·  view source on GitHub ↗
(
  durationInput: Duration.DurationInput
)

Source from the content-addressed store, hash-verified

675
676/** @internal */
677export const duration = (
678 durationInput: Duration.DurationInput
679): Schedule.Schedule<Duration.Duration> => {
680 const duration = Duration.decode(durationInput)
681 const durationMillis = Duration.toMillis(duration)
682 return makeWithState(true as boolean, (now, _, state) =>
683 core.succeed(
684 state
685 ? [
686 false,
687 duration,
688 ScheduleDecision.continueWith(Interval.after(now + durationMillis))
689 ] as const
690 : [false, Duration.zero, ScheduleDecision.done] as const
691 ))
692}
693
694/** @internal */
695export const either = dual<

Callers 1

fromDelayFunction · 0.70

Calls 2

makeWithStateFunction · 0.85
decodeMethod · 0.80

Tested by

no test coverage detected