effect-io-ai

Package: effect
Module: Schedule

Schedule.windowed

Creates a schedule that divides time into fixed interval-long windows, triggering execution at the start of each new window.

Details

This function produces a schedule that waits until the next time window boundary before executing. Each window spans a fixed duration specified by interval. If an action completes midway through a window, the schedule waits until the next full window starts before proceeding.

For example, windowed(Duration.seconds(10)) would produce a schedule as follows:

     10s        10s        10s       10s
|----------|----------|----------|----------|
|action------|sleep---|act|-sleep|action----|

Signature

declare const windowed: (interval: Duration.DurationInput) => Schedule<number>

Source

Since v2.0.0