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

Function duration

packages/effect/src/Schedule.ts:720–727  ·  view source on GitHub ↗
(durationInput: Duration.Input)

Source from the content-addressed store, hash-verified

718 * @since 2.0.0
719 */
720export const duration = (durationInput: Duration.Input): Schedule<Duration.Duration> => {
721 const duration = Duration.fromInputUnsafe(durationInput)
722 return fromStepWithMetadata(effect.succeed((meta) =>
723 meta.attempt === 1
724 ? effect.succeed([duration, duration])
725 : Cause.done(Duration.zero)
726 ))
727}
728
729/**
730 * Returns a new `Schedule` that will always recur, but only during the

Callers

nothing calls this directly

Calls 3

fromStepWithMetadataFunction · 0.85
succeedMethod · 0.45
doneMethod · 0.45

Tested by

no test coverage detected