-
Notifications
You must be signed in to change notification settings - Fork 453
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
Add reset and barrierAction to CyclicBarrier. #3055
Conversation
Both reset() and getNumberWaiting() are methods that exist on java.util.concurrent.CyclicBarrier and function in the same way.
I'm opening this PR in the hope of starting a conversation about the implementation and tests, both of which I'm aware could do with some improvement. |
arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/CyclicBarrier.kt
Outdated
Show resolved
Hide resolved
arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/CyclicBarrier.kt
Show resolved
Hide resolved
This is also from java.util.concurrent.CyclicBarrier and executes when the barrier opens due to its capacity being reached.
@HSAR thank you so much for the PR! I need to make some time to properly look at these changes, sorry it's been taking so long but it's not a PR I can quickly review 😅 On first sight it looks pretty good, but I need to dig around a bit and perhaps write some tests for myself. Concurrency is hard 😅 |
No problem. Keep me posted if/when you have questions or comments! |
Hey @HSAR, There are some tests hanging on CI, and also for me locally. Not sure if you have time to look into it, but I am also taking a look at it whilst reviewing the code. |
Hi @nomisRev - happy to take a look. I had thought that everything was passing when I left it last time, but I am very unfamiliar with this test framework and it is possible that I wasn't running it correctly. |
@HSAR I think we lost some history due to force-push, because I remember it passing at some time. You should be able to run the tests from IDEA. I think you can ignore I can always help you refactor them to Kotest if really need to. |
I expected to be able to run the tests from IDEA, but that doesn't seem to be the case (at least, not by default), which rather puzzled me. I'm personally only familiar with JUnit, but I am perfectly happy with any test framework if I can get it to run properly in my IDE. Are there extra steps I need to follow? Regarding the review, I restructured the code more than once to try and avoid problems with the reset action (which has turned out to be really rather tricky). This one works in many of scenarios but I don't think it is watertight - I am worried for instance about StateMachine::startNextEpoch which seems like it is not nearly atomic enough. |
Hey @HSAR, I am taking a stab at it from scratch, to see how far I can get it. That's easier for me to get my head around it 😅 I'll keep you posted today or tomorrow, so we can discuss code in further detail. To run Kotest you should install the IDEA Kotest plugin, but it sometimes doesn't behave perfectly. I can for example not run individual tests, only entire test files which is kind-of unfortunate. I've contemplated refactoring to JUnit Kotlin-test to leverage things like WASM, but that seems like a too big of an effort for now. |
I might hold off trying to fix the tests, as it seems entirely possible we might junk the current implementation anyway. Happy to chat code if it would help. |
I like the code inside
As for the git history, the code is yours and so should be the git blame ;) |
PS. Unused imports at the top of the file ;) |
Hey @HSAR, Sorry the entire process was so extraordinarily long.. Please do a thorough review of all my work, and I think with a review from @serras or @franciscodr we should be good to merg this work 🙌 |
Hey @nomisRev, I was a bit confused because I had pushed a different, more-conservative merge not too long ago. LGTM apart from one comment which I've left inline. I'm glad to have contributed! Thanks for your time looking into the issue and understanding the problems. |
arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/CyclicBarrier.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.
Nice job!
arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/CyclicBarrier.kt
Outdated
Show resolved
Hide resolved
...w-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/CyclicBarrierSpec.kt
Outdated
Show resolved
Hide resolved
...w-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/CyclicBarrierSpec.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Alejandro Serrano <trupill@gmail.com>
Thank you for the awesome work @HSAR! Congrats on your first contribution 🙌 Very impressive work! 👏 |
Happy to have my contribution accepted. Thanks for your part in this too! |
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.arrow-kt:arrow-optics-ksp-plugin](https://github.com/arrow-kt/arrow) | `1.1.5` -> `1.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-optics](https://github.com/arrow-kt/arrow) | `1.1.5` -> `1.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-core](https://github.com/arrow-kt/arrow) | `1.1.5` -> `1.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>arrow-kt/arrow (io.arrow-kt:arrow-optics-ksp-plugin)</summary> ### [`v1.2.0`](https://github.com/arrow-kt/arrow/releases/tag/1.2.0) [Compare Source](https://github.com/arrow-kt/arrow/compare/1.1.5...1.2.0) #### What's Changed - Add CNAME file to Dokka output by [@​franciscodr](https://github.com/franciscodr) in [https://github.com/arrow-kt/arrow/pull/3029](https://github.com/arrow-kt/arrow/pull/3029) - Remove legacy site code by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3030](https://github.com/arrow-kt/arrow/pull/3030) - Update README by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3033](https://github.com/arrow-kt/arrow/pull/3033) - Cancel previous PR action on new commit by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3032](https://github.com/arrow-kt/arrow/pull/3032) - Remove legacy script files by [@​franciscodr](https://github.com/franciscodr) in [https://github.com/arrow-kt/arrow/pull/3034](https://github.com/arrow-kt/arrow/pull/3034) - Ensure optics type with "data" modifier is a class by [@​DeoTimeTheGithubUser](https://github.com/DeoTimeTheGithubUser) in [https://github.com/arrow-kt/arrow/pull/3036](https://github.com/arrow-kt/arrow/pull/3036) - Update all dependencies (major) by [@​renovate](https://github.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3042](https://github.com/arrow-kt/arrow/pull/3042) - Remove test dependency from Arrow Fx by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3046](https://github.com/arrow-kt/arrow/pull/3046) - Bump Kotlin, KSP and coroutines version by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3047](https://github.com/arrow-kt/arrow/pull/3047) - fix mapIndexed when collecting multiple times by [@​hoc081098](https://github.com/hoc081098) in [https://github.com/arrow-kt/arrow/pull/3056](https://github.com/arrow-kt/arrow/pull/3056) - Update versions by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3058](https://github.com/arrow-kt/arrow/pull/3058) - optics ksp plugin: fixed handling of variance ([#​3057](https://github.com/arrow-kt/arrow/issues/3057)) by [@​vladd-g](https://github.com/vladd-g) in [https://github.com/arrow-kt/arrow/pull/3060](https://github.com/arrow-kt/arrow/pull/3060) - Fixes recover inconsistency with raise DSL on types other than Either by [@​yoxjames](https://github.com/yoxjames) in [https://github.com/arrow-kt/arrow/pull/3052](https://github.com/arrow-kt/arrow/pull/3052) - Change NonEmptySet type parameter name from T to A by [@​franciscodr](https://github.com/franciscodr) in [https://github.com/arrow-kt/arrow/pull/3062](https://github.com/arrow-kt/arrow/pull/3062) - Add withError and (Eager)Effect.mapError by [@​kyay10](https://github.com/kyay10) in [https://github.com/arrow-kt/arrow/pull/3059](https://github.com/arrow-kt/arrow/pull/3059) - Update versions of several libraries by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3017](https://github.com/arrow-kt/arrow/pull/3017) - Add merge builder for raise by [@​kyay10](https://github.com/kyay10) in [https://github.com/arrow-kt/arrow/pull/3061](https://github.com/arrow-kt/arrow/pull/3061) - Update all dependencies by [@​renovate](https://github.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3065](https://github.com/arrow-kt/arrow/pull/3065) - Update dependency gradle to v8.2 by [@​renovate](https://github.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3070](https://github.com/arrow-kt/arrow/pull/3070) - Fix warnings of single-subclass sealed classes by [@​jooohn](https://github.com/jooohn) in [https://github.com/arrow-kt/arrow/pull/3067](https://github.com/arrow-kt/arrow/pull/3067) - KDoc for `Raise#raise`, `Raise#ensure` and `Raise#ensureNotNull` by [@​ILIYANGERMANOV](https://github.com/ILIYANGERMANOV) in [https://github.com/arrow-kt/arrow/pull/3038](https://github.com/arrow-kt/arrow/pull/3038) - Fix text repetition in EffectScope's deprecation message by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3072](https://github.com/arrow-kt/arrow/pull/3072) - Introduce `NonEmptyCollection` by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3068](https://github.com/arrow-kt/arrow/pull/3068) - Set up Spotless by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3075](https://github.com/arrow-kt/arrow/pull/3075) - Update all dependencies by [@​renovate](https://github.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3079](https://github.com/arrow-kt/arrow/pull/3079) - Add option to disable `inline` when using `@optics` by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3078](https://github.com/arrow-kt/arrow/pull/3078) - Update JS versions in `yarn.lock` by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3084](https://github.com/arrow-kt/arrow/pull/3084) - Enable Automatic Modules for JVM by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3071](https://github.com/arrow-kt/arrow/pull/3071) - Serialization module by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3077](https://github.com/arrow-kt/arrow/pull/3077) - Add missing docs for `Raise` operations by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3082](https://github.com/arrow-kt/arrow/pull/3082) - Add mapOrAccumulate extension in RaiseAccumulate by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3086](https://github.com/arrow-kt/arrow/pull/3086) - Additional tests for `copy` in Optics by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3089](https://github.com/arrow-kt/arrow/pull/3089) - Apply Gradle Versioning in top project by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3092](https://github.com/arrow-kt/arrow/pull/3092) - Add missing Versioning plug-in to `arrow-core-retrofit` by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3093](https://github.com/arrow-kt/arrow/pull/3093) - Update `arrow-gradle-config` to 0.12-rc.4 by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3094](https://github.com/arrow-kt/arrow/pull/3094) - MemoizedDeepRecursiveFunction by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3091](https://github.com/arrow-kt/arrow/pull/3091) - Add reset and barrierAction to CyclicBarrier. by [@​HSAR](https://github.com/HSAR) in [https://github.com/arrow-kt/arrow/pull/3055](https://github.com/arrow-kt/arrow/pull/3055) - \[HOTFIX] Fix main publish by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3095](https://github.com/arrow-kt/arrow/pull/3095) #### New Contributors - [@​DeoTimeTheGithubUser](https://github.com/DeoTimeTheGithubUser) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3036](https://github.com/arrow-kt/arrow/pull/3036) - [@​vladd-g](https://github.com/vladd-g) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3060](https://github.com/arrow-kt/arrow/pull/3060) - [@​yoxjames](https://github.com/yoxjames) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3052](https://github.com/arrow-kt/arrow/pull/3052) - [@​kyay10](https://github.com/kyay10) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3059](https://github.com/arrow-kt/arrow/pull/3059) - [@​jooohn](https://github.com/jooohn) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3067](https://github.com/arrow-kt/arrow/pull/3067) - [@​ILIYANGERMANOV](https://github.com/ILIYANGERMANOV) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3038](https://github.com/arrow-kt/arrow/pull/3038) - [@​HSAR](https://github.com/HSAR) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3055](https://github.com/arrow-kt/arrow/pull/3055) **Full Changelog**: arrow-kt/arrow@1.2.0-RC...1.2.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/sindrenm/android-project-template). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi41LjMiLCJ1cGRhdGVkSW5WZXIiOiIzNi41LjMiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.arrow-kt:arrow-fx-coroutines](https://github.com/arrow-kt/arrow) | `1.1.3` -> `1.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-optics-ksp-plugin](https://github.com/arrow-kt/arrow) | `1.1.3` -> `1.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-optics](https://github.com/arrow-kt/arrow) | `1.1.3` -> `1.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-core](https://github.com/arrow-kt/arrow) | `1.1.3` -> `1.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-stack](https://github.com/arrow-kt/arrow) | `1.1.3` -> `1.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>arrow-kt/arrow (io.arrow-kt:arrow-fx-coroutines)</summary> ### [`v1.2.0`](https://github.com/arrow-kt/arrow/releases/tag/1.2.0) [Compare Source](https://github.com/arrow-kt/arrow/compare/1.1.5...1.2.0) ##### What's Changed - Add CNAME file to Dokka output by [@​franciscodr](https://github.com/franciscodr) in [https://github.com/arrow-kt/arrow/pull/3029](https://github.com/arrow-kt/arrow/pull/3029) - Remove legacy site code by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3030](https://github.com/arrow-kt/arrow/pull/3030) - Update README by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3033](https://github.com/arrow-kt/arrow/pull/3033) - Cancel previous PR action on new commit by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3032](https://github.com/arrow-kt/arrow/pull/3032) - Remove legacy script files by [@​franciscodr](https://github.com/franciscodr) in [https://github.com/arrow-kt/arrow/pull/3034](https://github.com/arrow-kt/arrow/pull/3034) - Ensure optics type with "data" modifier is a class by [@​DeoTimeTheGithubUser](https://github.com/DeoTimeTheGithubUser) in [https://github.com/arrow-kt/arrow/pull/3036](https://github.com/arrow-kt/arrow/pull/3036) - Update all dependencies (major) by [@​renovate](https://github.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3042](https://github.com/arrow-kt/arrow/pull/3042) - Remove test dependency from Arrow Fx by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3046](https://github.com/arrow-kt/arrow/pull/3046) - Bump Kotlin, KSP and coroutines version by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3047](https://github.com/arrow-kt/arrow/pull/3047) - fix mapIndexed when collecting multiple times by [@​hoc081098](https://github.com/hoc081098) in [https://github.com/arrow-kt/arrow/pull/3056](https://github.com/arrow-kt/arrow/pull/3056) - Update versions by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3058](https://github.com/arrow-kt/arrow/pull/3058) - optics ksp plugin: fixed handling of variance ([#​3057](https://github.com/arrow-kt/arrow/issues/3057)) by [@​vladd-g](https://github.com/vladd-g) in [https://github.com/arrow-kt/arrow/pull/3060](https://github.com/arrow-kt/arrow/pull/3060) - Fixes recover inconsistency with raise DSL on types other than Either by [@​yoxjames](https://github.com/yoxjames) in [https://github.com/arrow-kt/arrow/pull/3052](https://github.com/arrow-kt/arrow/pull/3052) - Change NonEmptySet type parameter name from T to A by [@​franciscodr](https://github.com/franciscodr) in [https://github.com/arrow-kt/arrow/pull/3062](https://github.com/arrow-kt/arrow/pull/3062) - Add withError and (Eager)Effect.mapError by [@​kyay10](https://github.com/kyay10) in [https://github.com/arrow-kt/arrow/pull/3059](https://github.com/arrow-kt/arrow/pull/3059) - Update versions of several libraries by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3017](https://github.com/arrow-kt/arrow/pull/3017) - Add merge builder for raise by [@​kyay10](https://github.com/kyay10) in [https://github.com/arrow-kt/arrow/pull/3061](https://github.com/arrow-kt/arrow/pull/3061) - Update all dependencies by [@​renovate](https://github.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3065](https://github.com/arrow-kt/arrow/pull/3065) - Update dependency gradle to v8.2 by [@​renovate](https://github.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3070](https://github.com/arrow-kt/arrow/pull/3070) - Fix warnings of single-subclass sealed classes by [@​jooohn](https://github.com/jooohn) in [https://github.com/arrow-kt/arrow/pull/3067](https://github.com/arrow-kt/arrow/pull/3067) - KDoc for `Raise#raise`, `Raise#ensure` and `Raise#ensureNotNull` by [@​ILIYANGERMANOV](https://github.com/ILIYANGERMANOV) in [https://github.com/arrow-kt/arrow/pull/3038](https://github.com/arrow-kt/arrow/pull/3038) - Fix text repetition in EffectScope's deprecation message by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3072](https://github.com/arrow-kt/arrow/pull/3072) - Introduce `NonEmptyCollection` by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3068](https://github.com/arrow-kt/arrow/pull/3068) - Set up Spotless by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3075](https://github.com/arrow-kt/arrow/pull/3075) - Update all dependencies by [@​renovate](https://github.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3079](https://github.com/arrow-kt/arrow/pull/3079) - Add option to disable `inline` when using `@optics` by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3078](https://github.com/arrow-kt/arrow/pull/3078) - Update JS versions in `yarn.lock` by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3084](https://github.com/arrow-kt/arrow/pull/3084) - Enable Automatic Modules for JVM by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3071](https://github.com/arrow-kt/arrow/pull/3071) - Serialization module by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3077](https://github.com/arrow-kt/arrow/pull/3077) - Add missing docs for `Raise` operations by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3082](https://github.com/arrow-kt/arrow/pull/3082) - Add mapOrAccumulate extension in RaiseAccumulate by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3086](https://github.com/arrow-kt/arrow/pull/3086) - Additional tests for `copy` in Optics by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3089](https://github.com/arrow-kt/arrow/pull/3089) - Apply Gradle Versioning in top project by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3092](https://github.com/arrow-kt/arrow/pull/3092) - Add missing Versioning plug-in to `arrow-core-retrofit` by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3093](https://github.com/arrow-kt/arrow/pull/3093) - Update `arrow-gradle-config` to 0.12-rc.4 by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3094](https://github.com/arrow-kt/arrow/pull/3094) - MemoizedDeepRecursiveFunction by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3091](https://github.com/arrow-kt/arrow/pull/3091) - Add reset and barrierAction to CyclicBarrier. by [@​HSAR](https://github.com/HSAR) in [https://github.com/arrow-kt/arrow/pull/3055](https://github.com/arrow-kt/arrow/pull/3055) - \[HOTFIX] Fix main publish by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3095](https://github.com/arrow-kt/arrow/pull/3095) ##### New Contributors - [@​DeoTimeTheGithubUser](https://github.com/DeoTimeTheGithubUser) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3036](https://github.com/arrow-kt/arrow/pull/3036) - [@​vladd-g](https://github.com/vladd-g) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3060](https://github.com/arrow-kt/arrow/pull/3060) - [@​yoxjames](https://github.com/yoxjames) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3052](https://github.com/arrow-kt/arrow/pull/3052) - [@​kyay10](https://github.com/kyay10) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3059](https://github.com/arrow-kt/arrow/pull/3059) - [@​jooohn](https://github.com/jooohn) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3067](https://github.com/arrow-kt/arrow/pull/3067) - [@​ILIYANGERMANOV](https://github.com/ILIYANGERMANOV) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3038](https://github.com/arrow-kt/arrow/pull/3038) - [@​HSAR](https://github.com/HSAR) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3055](https://github.com/arrow-kt/arrow/pull/3055) **Full Changelog**: arrow-kt/arrow@1.2.0-RC...1.2.0 ### [`v1.1.5`](https://github.com/arrow-kt/arrow/releases/tag/1.1.5) [Compare Source](https://github.com/arrow-kt/arrow/compare/1.1.4...1.1.5) #### What's Changed - Remove `test` modules by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/2874](https://github.com/arrow-kt/arrow/pull/2874) - Mention Arrow 2.0 in README by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/2878](https://github.com/arrow-kt/arrow/pull/2878) - Prisms for Either by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/2877](https://github.com/arrow-kt/arrow/pull/2877) - Test 1.8.0 on CI by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2864](https://github.com/arrow-kt/arrow/pull/2864) - Implement 'align' using 'buildList' by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/2886](https://github.com/arrow-kt/arrow/pull/2886) - Improve debugging experience of leaked shift calls by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2884](https://github.com/arrow-kt/arrow/pull/2884) - Fix knitCheck & re-add check by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2887](https://github.com/arrow-kt/arrow/pull/2887) **Full Changelog**: arrow-kt/arrow@1.1.4...1.1.5 ### [`v1.1.4`](https://github.com/arrow-kt/arrow/releases/tag/1.1.4) [Compare Source](https://github.com/arrow-kt/arrow/compare/1.1.3...1.1.4) #### What's Changed - \[2743] Migrate internal use of CircuitBreaker double to duration by [@​mjmoore](https://github.com/mjmoore) in [https://github.com/arrow-kt/arrow/pull/2748](https://github.com/arrow-kt/arrow/pull/2748) - Fix typo by [@​valery1707](https://github.com/valery1707) in [https://github.com/arrow-kt/arrow/pull/2824](https://github.com/arrow-kt/arrow/pull/2824) - Make the server disconnect test more general by [@​lukasz-kalnik-gcx](https://github.com/lukasz-kalnik-gcx) in [https://github.com/arrow-kt/arrow/pull/2822](https://github.com/arrow-kt/arrow/pull/2822) - Update NonEmptyList.fromList deprecation to suggest `toOption()` instead by [@​StylianosGakis](https://github.com/StylianosGakis) in [https://github.com/arrow-kt/arrow/pull/2832](https://github.com/arrow-kt/arrow/pull/2832) - Improve Either.getOrHandle() docs by [@​lukasz-kalnik-gcx](https://github.com/lukasz-kalnik-gcx) in [https://github.com/arrow-kt/arrow/pull/2833](https://github.com/arrow-kt/arrow/pull/2833) - Correct `addressStrees` -> `addressStreet` in optics documentation by [@​vikrem](https://github.com/vikrem) in [https://github.com/arrow-kt/arrow/pull/2836](https://github.com/arrow-kt/arrow/pull/2836) - Arrow Fx: deprecate Platform#composeError, never and unit() by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2837](https://github.com/arrow-kt/arrow/pull/2837) - Backport Optics KSP plugin NPE on multiplatform fix by [@​cvb941](https://github.com/cvb941) in [https://github.com/arrow-kt/arrow/pull/2840](https://github.com/arrow-kt/arrow/pull/2840) - Refactor - [#​2812](https://github.com/arrow-kt/arrow/issues/2812) sequence separate performance by [@​Khepu](https://github.com/Khepu) in [https://github.com/arrow-kt/arrow/pull/2818](https://github.com/arrow-kt/arrow/pull/2818) - Use `super` equals and hashCode overrides for NonEmptyList by [@​RusticFlare](https://github.com/RusticFlare) in [https://github.com/arrow-kt/arrow/pull/2825](https://github.com/arrow-kt/arrow/pull/2825) - Resource API deprecation, and preparation for 2.x.x. & back port improvements by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2847](https://github.com/arrow-kt/arrow/pull/2847) - introduce iterable.toNonEmptyListOrNone() by [@​myuwono](https://github.com/myuwono) in [https://github.com/arrow-kt/arrow/pull/2843](https://github.com/arrow-kt/arrow/pull/2843) - \[PROPOSAL] Either API deprecation, and preparation for 2.x.x by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2830](https://github.com/arrow-kt/arrow/pull/2830) - Use major versions in GitHub Actions by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/2849](https://github.com/arrow-kt/arrow/pull/2849) - Weaken Either monoid dependencies to only require a semigroup on left by [@​mjvmroz](https://github.com/mjvmroz) in [https://github.com/arrow-kt/arrow/pull/2845](https://github.com/arrow-kt/arrow/pull/2845) - Do not reuse the name of the file in Optics KSP by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/2850](https://github.com/arrow-kt/arrow/pull/2850) - Additional deprecations, and backports for JVM by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2856](https://github.com/arrow-kt/arrow/pull/2856) - Update various versions by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/2852](https://github.com/arrow-kt/arrow/pull/2852) - Add CountDownLatch by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2854](https://github.com/arrow-kt/arrow/pull/2854) - Add CyclicBarrier by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2857](https://github.com/arrow-kt/arrow/pull/2857) - Temp rollback error handling deprecations until 1.2.x by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2858](https://github.com/arrow-kt/arrow/pull/2858) - Setup Kover as test coverage tool by [@​MarkMarkyMarkus](https://github.com/MarkMarkyMarkus) in [https://github.com/arrow-kt/arrow/pull/2793](https://github.com/arrow-kt/arrow/pull/2793) - Fix Monad.either binary combat by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2867](https://github.com/arrow-kt/arrow/pull/2867) - Backport: MPP No Trace by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2869](https://github.com/arrow-kt/arrow/pull/2869) #### New Contributors - [@​mjmoore](https://github.com/mjmoore) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2748](https://github.com/arrow-kt/arrow/pull/2748) - [@​valery1707](https://github.com/valery1707) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2824](https://github.com/arrow-kt/arrow/pull/2824) - [@​lukasz-kalnik-gcx](https://github.com/lukasz-kalnik-gcx) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2822](https://github.com/arrow-kt/arrow/pull/2822) - [@​StylianosGakis](https://github.com/StylianosGakis) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2832](https://github.com/arrow-kt/arrow/pull/2832) - [@​vikrem](https://github.com/vikrem) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2836](https://github.com/arrow-kt/arrow/pull/2836) - [@​cvb941](https://github.com/cvb941) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2840](https://github.com/arrow-kt/arrow/pull/2840) - [@​RusticFlare](https://github.com/RusticFlare) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2825](https://github.com/arrow-kt/arrow/pull/2825) - [@​mjvmroz](https://github.com/mjvmroz) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2845](https://github.com/arrow-kt/arrow/pull/2845) - [@​MarkMarkyMarkus](https://github.com/MarkMarkyMarkus) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2793](https://github.com/arrow-kt/arrow/pull/2793) **Full Changelog**: arrow-kt/arrow@1.1.3...1.1.4-rc.3 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/elide-dev/elide). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMTEuMCIsInRhcmdldEJyYW5jaCI6InYzIn0=-->
* Added reset() and numberWaiting to CyclicBarrier. Both reset() and getNumberWaiting() are methods that exist on java.util.concurrent.CyclicBarrier and function in the same way. * Added barrierAction optional constructor variable to CyclicBarrier. This is also from java.util.concurrent.CyclicBarrier and executes when the barrier opens due to its capacity being reached. * Use sealed classes to model separate reset state in CyclicBarrier. * Implement reset on CyclicBarrier * Update API files * Retrigger CI after apiDump * Merge work @nomisRev and @HSAR * Apply suggestions from code review Co-authored-by: Alejandro Serrano <trupill@gmail.com> * Apply PR suggestions * Fix compilation issue * apiDump * Remove peekWaiting as discussed with @HSAR * apiDump * Fix tests --------- Co-authored-by: Simon Vergauwen <nomisRev@users.noreply.github.com> Co-authored-by: Alejandro Serrano <trupill@gmail.com>
Both reset() and getNumberWaiting() are methods that exist on java.util.concurrent.CyclicBarrier and function in the same way.
This PR comes from discussion on issue #3054.