https://kotlinlang.org logo
#arrow
Title
# arrow
b

bj0

12/06/2023, 11:15 PM
Im looking at the
retry
documentation and it looks like it retries an action until it doesn't throw an exception? if my action/function returns an
Either
, how would I make it retry on
Left
until
Right
?
y

Youssef Shoaib [MOD]

12/07/2023, 6:24 AM
Surely something as simple as
myEither.getOrElse { error("foo") }
suffices
a

Alejandro Serrano.Mena

12/07/2023, 8:14 AM
you can use build s
Schedule
using things like
doUntil
(https://apidocs.arrow-kt.io/arrow-resilience/arrow.resilience/-schedule/do-until.html) which would check whether the result is a
Left
🔝 1
b

bj0

12/07/2023, 3:27 PM
Ah, maybe i'll try
doUntil
, I was trying to avoid using exceptions
2 Views