Emil Kantis
private val connectRetryPolicy = Schedule .spaced<Either<Throwable, Unit>>(retryDelay) .and(Schedule.recurs(maxAttempts)) .doUntil { input, _ -> input.isRight() }
Either.Right
.repeat(primaryAction)
val policy = Schedule.identity<Either<Throwable, Unit>> .zipLeft(Schedule.spaced(retryDelay)) .zipLeft(Schedule.recurs(maxAttempts)) .doUntil { _, output -> output.isRight() } policy.repeat(primaryAction) .fold( ifLeft = { failureAction() } ifRight = { <http://log.info|log.info>("Success") } )
A modern programming language that makes developers happier.