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

Function retryLoop

packages/effect/src/internal/layer.ts:889–904  ·  view source on GitHub ↗
(
  self: Layer.Layer<ROut, E, RIn>,
  schedule: Schedule.Schedule<X, E, RIn2>,
  stateTag: Context.Tag<{ state: unknown }, { state: unknown }>,
  state: unknown
)

Source from the content-addressed store, hash-verified

887 }))
888
889const retryLoop = <ROut, E, RIn, X, RIn2>(
890 self: Layer.Layer<ROut, E, RIn>,
891 schedule: Schedule.Schedule<X, E, RIn2>,
892 stateTag: Context.Tag<{ state: unknown }, { state: unknown }>,
893 state: unknown
894): Layer.Layer<ROut, E, RIn | RIn2> => {
895 return pipe(
896 self,
897 catchAll((error) =>
898 pipe(
899 retryUpdate(schedule, stateTag, error, state),
900 flatMap((env) => fresh(retryLoop(self, schedule, stateTag, pipe(env, Context.get(stateTag)).state)))
901 )
902 )
903 )
904}
905
906const retryUpdate = <X, E, RIn>(
907 schedule: Schedule.Schedule<X, E, RIn>,

Callers 1

layer.tsFile · 0.85

Calls 4

retryUpdateFunction · 0.85
freshFunction · 0.85
pipeFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…