-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added retryRaise and retryEither functions #3373
Conversation
I think it might be preferable if this API used |
ab2f35f
to
7caa814
Compare
do you mean like this? public suspend fun <Error, Result, Output> Schedule<Error, Output>.retry(
action: suspend Raise<Error>.() -> Result,
): Either<Error, Result> I could even wrap it in raise context but it is not enabled in arrow context (Raise<Error>)
public suspend fun <Error, Result, Output> Schedule<Error, Output>.retry(
action: suspend Raise<Error>.() -> Result,
): Result |
7caa814
to
bb050aa
Compare
arrow-libs/resilience/arrow-resilience/src/commonMain/kotlin/arrow/resilience/ScheduleEither.kt
Outdated
Show resolved
Hide resolved
arrow-libs/resilience/arrow-resilience/src/commonMain/kotlin/arrow/resilience/ScheduleEither.kt
Outdated
Show resolved
Hide resolved
bb050aa
to
afe431d
Compare
c131af6
to
dec5037
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks great to me, but I would like to ask you to add everything to the Schedule.kt
file instead. The reason is that this way the functions go into the ScheduleKt
class, which makes our life a bit easier when checking binary compatibility aftewards.
Thanks for your contribution, @akotynski !
dec5037
to
c71e6e8
Compare
sure! Moved code to Schedule.kt file Thank you all for your quick reply and support :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful implementation!!
Hey, with the latest API, it is easy to write Either version of the retry function. I think it could be quite useful.
I based the implementation on
public suspend fun <A> Schedule<Throwable, *>.retry(action: suspend () -> A): A