arrow-fx
arrow-fx copied to clipboard
Flow `Schedule` constructor
A constructor to create a Flow from a given Schedule. Given a f: suspend () -> A and a Schedule<A, B> we can construct a Flow<B> that executes f according to the provided Schedule<A, B> on repeat.
Schedule.spaced(100.millis)
.toFlow { i: Int -> println("Run # $i") }
.collect() // Run # 1, Run # 2, ...