MCPcopy Index your code
hub / github.com/Effect-TS/effect / retryOnInterrupt

Function retryOnInterrupt

packages/workflow/src/Activity.ts:134–146  ·  view source on GitHub ↗
(
  name: string,
  policy: Schedule.Schedule<any, Cause.Cause<unknown>> = interruptRetryPolicy
)

Source from the content-addressed store, hash-verified

132)
133
134const retryOnInterrupt = (
135 name: string,
136 policy: Schedule.Schedule<any, Cause.Cause<unknown>> = interruptRetryPolicy
137) =>
138<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>
139 effect.pipe(
140 Effect.sandbox,
141 Effect.retry(policy),
142 Effect.catchAll((cause) => {
143 if (!Cause.isInterrupted(cause)) return Effect.failCause(cause)
144 return Effect.die(`Activity "${name}" interrupted and retry attempts exhausted`)
145 })
146 )
147
148/**
149 * @since 1.0.0

Callers 1

makeFunction · 0.85

Calls 4

isInterruptedMethod · 0.80
failCauseMethod · 0.80
pipeMethod · 0.65
dieMethod · 0.65

Tested by

no test coverage detected