( base: Duration.Input, factor: number = 2 )
| 848 | * @since 2.0.0 |
| 849 | */ |
| 850 | export const exponential = ( |
| 851 | base: Duration.Input, |
| 852 | factor: number = 2 |
| 853 | ): Schedule<Duration.Duration> => { |
| 854 | const baseMillis = Duration.toMillis(Duration.fromInputUnsafe(base)) |
| 855 | return fromStepWithMetadata(effect.succeed((meta) => { |
| 856 | const duration = Duration.millis(baseMillis * Math.pow(factor, meta.attempt - 1)) |
| 857 | return effect.succeed([duration, duration]) |
| 858 | })) |
| 859 | } |
| 860 | |
| 861 | /** |
| 862 | * Schedule that always recurs, increasing delays by summing the preceding |
nothing calls this directly
no test coverage detected