arrow-fx / arrow.fx / Schedule / delayed

delayed

fun delayed(f: (Duration) -> Duration): Schedule<F, Input, Output>

Adjust the delay of a schedule’s Decision

fun <F, A> delayed(M: Monad<F>, delaySchedule: Schedule<F, A, Duration>): Schedule<F, A, Duration>

Create a schedule that uses another schedule to generate the delay of this schedule. Continues for as long as delaySchedule continues and adds the output of delaySchedule to the delay that delaySchedule produced. Also returns the full delay as output.

A common use case is to define a unfolding schedule and use the result to change the delay. For an example see the implementation of spaced, linear, fibonacci or exponential

Do you like Arrow?

Arrow Org
<