(interval: Duration.Input)
| 1408 | * @since 2.0.0 |
| 1409 | */ |
| 1410 | export const windowed = (interval: Duration.Input): Schedule<number> => { |
| 1411 | const window = Duration.toMillis(Duration.fromInputUnsafe(interval)) |
| 1412 | return fromStepWithMetadata(effect.succeed((meta) => |
| 1413 | effect.sync(() => [ |
| 1414 | meta.attempt - 1, |
| 1415 | window === 0 ? Duration.zero : Duration.millis(window - (meta.elapsed % window)) |
| 1416 | ]) |
| 1417 | )) |
| 1418 | } |
| 1419 | |
| 1420 | /** |
| 1421 | * Returns a new `Schedule` that will recur forever. |
nothing calls this directly
no test coverage detected