Schedule
A Schedule describes how a suspend fun
should retry or repeat.
It's defined by a step function that takes an Input and returns a Decision, the Decision determines if the suspend fun
should be Continue to be retried or repeated (and if so, the delay
until the next attempt), or if the Schedule is Done retrying or repeating.
Types
Functions
Combines two Schedules into one by combining the output of both Schedules into a Pair. It chooses the longest delay between the two Schedules. If one of the Schedules is done, the other Schedule is not executed anymore.
Combines two Schedules into one by transforming the output of both Schedules using transform. It chooses the longest delay between the two Schedules. If one of the Schedules is done, the other Schedule is not executed anymore.
Runs this
schedule until Done, and then runs other until Done. Wrapping the output of this
in Either.Left, and the output of other in Either.Right.
Retries action using any Throwable that occurred as the input to the Schedule. If the Schedule is exhausted, it will invoke orElse with the last exception and the output of the Schedule to produce a fallback value of A. Returns Either with the fallback value if the Schedule is exhausted, or the successful result of action.