radekm
10/08/2020, 8:47 AMsuspend fun <A, B, C> retryOrElseEither(
schedule: Schedule<A, B>,
fa: suspend () -> A,
orElse: suspend (Throwable, B) -> C
): Either<C, A>
Why is input of schedule
type A
instead of Throwable
? I'm trying to use it but I can't figure howraulraja
10/08/2020, 9:00 AMorElse
raulraja
10/08/2020, 9:00 AMJannis
10/08/2020, 10:32 AMretry
runs the schedule only on failure so the input should be Throwable
. The IO
version of this accepts Throwable
or E
(with MonadError) here whereas the suspend
version doesn't. It is also casted to Schedule<Throwable, B>
in the implementation so I believe this is a bug.
@radekm for now you can probably get away with casting the Schedule
to something like Schedule<Throwable, B>
or similar
@simon.vergauwen Is there a reason this changed when moving to suspend
? If it's just an oversight I'll look into changing it^^simon.vergauwen
10/08/2020, 11:09 AMradekm
10/08/2020, 12:12 PMraulraja
10/08/2020, 4:33 PM