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

Function scheduleFromStep

packages/effect/src/internal/executionPlan.ts:191–214  ·  view source on GitHub ↗
(
  step: Api.ExecutionPlan<{
    provides: Provides
    input: In
    error: PlanE
    requirements: PlanR
  }>["steps"][number],
  first: boolean
)

Source from the content-addressed store, hash-verified

189
190/** @internal */
191export const scheduleFromStep = <Provides, In, PlanE, PlanR>(
192 step: Api.ExecutionPlan<{
193 provides: Provides
194 input: In
195 error: PlanE
196 requirements: PlanR
197 }>["steps"][number],
198 first: boolean
199) => {
200 if (!first) {
201 return internalSchedule.buildFromOptions({
202 schedule: step.schedule ? step.schedule : step.attempts ? undefined : scheduleOnce,
203 times: step.attempts,
204 while: step.while
205 })
206 } else if (step.attempts === 1 || !(step.schedule || step.attempts)) {
207 return undefined
208 }
209 return internalSchedule.buildFromOptions({
210 schedule: step.schedule,
211 while: step.while,
212 times: step.attempts ? step.attempts - 1 : undefined
213 })
214}
215
216const scheduleOnce = Schedule.recurs(1)

Callers 1

bodyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected