@@ -12,6 +12,7 @@ import type * as Deferred from "./Deferred.js"
1212import type * as Duration from "./Duration.js"
1313import type * as Either from "./Either.js"
1414import type { Equivalence } from "./Equivalence.js"
15+ import type { ExecutionPlan } from "./ExecutionPlan.js"
1516import type { ExecutionStrategy } from "./ExecutionStrategy.js"
1617import type * as Exit from "./Exit.js"
1718import type * as Fiber from "./Fiber.js"
@@ -32,6 +33,7 @@ import * as effect from "./internal/core-effect.js"
3233import * as core from "./internal/core.js"
3334import * as defaultServices from "./internal/defaultServices.js"
3435import * as circular from "./internal/effect/circular.js"
36+ import * as internalExecutionPlan from "./internal/executionPlan.js"
3537import * as fiberRuntime from "./internal/fiberRuntime.js"
3638import * as layer from "./internal/layer.js"
3739import * as option_ from "./internal/option.js"
@@ -4398,22 +4400,33 @@ export declare namespace Retry {
43984400export const retry : {
43994401 < E , O extends NoExcessProperties < Retry . Options < E > , O > > (
44004402 options : O
4401- ) : < A , R > (
4402- self : Effect < A , E , R >
4403- ) => Retry . Return < R , E , A , O >
4404- < B , E , R1 > (
4405- policy : Schedule . Schedule < B , NoInfer < E > , R1 >
4406- ) : < A , R > ( self : Effect < A , E , R > ) => Effect < A , E , R1 | R >
4403+ ) : < A , R > ( self : Effect < A , E , R > ) => Retry . Return < R , E , A , O >
4404+ < B , E , R1 > ( policy : Schedule . Schedule < B , NoInfer < E > , R1 > ) : < A , R > ( self : Effect < A , E , R > ) => Effect < A , E , R1 | R >
44074405 < A , E , R , O extends NoExcessProperties < Retry . Options < E > , O > > (
44084406 self : Effect < A , E , R > ,
44094407 options : O
44104408 ) : Retry . Return < R , E , A , O >
4411- < A , E , R , B , R1 > (
4412- self : Effect < A , E , R > ,
4413- policy : Schedule . Schedule < B , E , R1 >
4414- ) : Effect < A , E , R1 | R >
4409+ < A , E , R , B , R1 > ( self : Effect < A , E , R > , policy : Schedule . Schedule < B , NoInfer < E > , R1 > ) : Effect < A , E , R1 | R >
44154410} = schedule_ . retry_combined
44164411
4412+ /**
4413+ * Apply an `ExecutionPlan` to the effect, which allows you to fallback to
4414+ * different resources in case of failure.
4415+ *
4416+ * @since 3.16.0
4417+ * @category Error handling
4418+ * @experimental
4419+ */
4420+ export const withExecutionPlan : {
4421+ < Input , Provides , PlanE , PlanR > (
4422+ plan : ExecutionPlan < { provides : Provides ; input : Input ; error : PlanE ; requirements : PlanR } >
4423+ ) : < A , E extends Input , R > ( effect : Effect < A , E , R > ) => Effect < A , E | PlanE , Exclude < R , Provides > | PlanR >
4424+ < A , E extends Input , R , Provides , Input , PlanE , PlanR > (
4425+ effect : Effect < A , E , R > ,
4426+ plan : ExecutionPlan < { provides : Provides ; input : Input ; error : PlanE ; requirements : PlanR } >
4427+ ) : Effect < A , E | PlanE , Exclude < R , Provides > | PlanR >
4428+ } = internalExecutionPlan . withExecutionPlan
4429+
44174430/**
44184431 * Retries a failing effect and runs a fallback effect if retries are exhausted.
44194432 *
@@ -10348,7 +10361,7 @@ export const scheduleForked: {
1034810361 self : Effect < A , E , R > ,
1034910362 schedule : Schedule . Schedule < Out , unknown , R2 >
1035010363 ) : Effect < Fiber . RuntimeFiber < Out , E > , never , Scope . Scope | R | R2 >
10351- } = circular . scheduleForked
10364+ } = schedule_ . scheduleForked
1035210365
1035310366/**
1035410367 * Runs an effect repeatedly according to a schedule, starting from a specified
0 commit comments