-
Notifications
You must be signed in to change notification settings - Fork 22
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
Resilience #56
Resilience #56
Conversation
serras
commented
Mar 6, 2023
•
edited
Loading
edited
- Intro
- Schedule
- CircuitBreaker
- Saga
@ExperimentalTime | ||
fun <A> complexPolicy(): Schedule<A, List<A>> = | ||
Schedule.exponential<A>(10.milliseconds).whileOutput { it < 60.seconds } | ||
.andThen(Schedule.spaced<A>(60.seconds) and Schedule.recurs(100)).jittered() |
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.
Should we mention what jittered
does?
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.
Added a line, I hadn't realized it was there
Schedule.doWhile<Int>{ it <= 5 }.repeat { | ||
counter++ | ||
} |
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.
This example may confuse some people because they could think the predicate is applied over the counter. What do you think? Would it be worth mentioning that it
refers to the number of iterations? 0 to 5 plus the first successful execution?
After that, whenever more than two requests fail with an exception, | ||
the circuit breaker starts short-circuiting failing-fast. | ||
|
||
A new instance of `CircuitBreaker` is created using [`of`](https://arrow-kt.github.io/arrow/arrow-fx-resilience/arrow.fx.resilience/-circuit-breaker/-companion/of.html); there we specify |
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.
The of
builder has been deprecated since Arrow 1.2 in favor of the class constructor
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.
I added a note
Co-authored-by: Francisco Diaz <francisco.d@47deg.com>
Co-authored-by: Francisco Diaz <francisco.d@47deg.com>
Co-authored-by: Francisco Diaz <francisco.d@47deg.com>
Co-authored-by: Francisco Diaz <francisco.d@47deg.com>