-
Notifications
You must be signed in to change notification settings - Fork 448
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
Update Circuit Breaker & remove Arrow Fx Coroutines dependency from Resilience #2905
Conversation
nomisRev
commented
Jan 26, 2023
•
edited by franciscodr
Loading
edited by franciscodr
- Switch to TimeMark instead of timeMillis
- Introduce OpeningStrategy
- Add SlidingWindow OpeningStrategy
- Remove dependency on Bracket / Arrow Fx Coroutines from Arrow Fx Resilience
There is currently a problem where Kotest is stuck on 1.6.x, and there was a breaking change in This makes the tests fail with:
|
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.
@franciscodr looks great! 👏 👏 Thanks for tacking this on 🙏 (I cannot approve my won PR 😅).
nit: I think 500_000
iterations for JVM is really excessive for stack-safety test 😂
Can't remember where that number came from. We used to have it around 20_000 for JVM/Native, and 5000 for JS IIRC..
nit: common native code can also be put in nativeMain
, and they don't have to repeat it for every platform.
We can look into both nits at a later time, they're not-blocking for this PR IMO.
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.
Looking great @franciscodr. Awesome work, thank you 🙌
Just a couple of nits, and suggestions
arrow-libs/fx/arrow-fx-resilience/src/commonMain/kotlin/arrow/fx/resilience/CircuitBreaker.kt
Outdated
Show resolved
Hide resolved
arrow-libs/fx/arrow-fx-resilience/src/commonMain/kotlin/arrow/fx/resilience/CircuitBreaker.kt
Outdated
Show resolved
Hide resolved
arrow-libs/fx/arrow-fx-resilience/src/commonMain/kotlin/arrow/fx/resilience/CircuitBreaker.kt
Outdated
Show resolved
Hide resolved
arrow-libs/fx/arrow-fx-resilience/src/commonMain/kotlin/arrow/fx/resilience/CircuitBreaker.kt
Outdated
Show resolved
Hide resolved
...-libs/fx/arrow-fx-resilience/src/commonTest/kotlin/arrow/fx/resilience/CircuitBreakerTest.kt
Outdated
Show resolved
Hide resolved
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.
2 small nits:
- Incorrect usage of
compareAndSet
- Mistake in my previous suggestion.