Skip to content
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

Various small STM improvements #3419

Merged
merged 4 commits into from
May 17, 2024
Merged

Various small STM improvements #3419

merged 4 commits into from
May 17, 2024

Conversation

serras
Copy link
Member

@serras serras commented May 14, 2024

  • More idiomatic TVar<A>.value
  • Introduce TVar<A>.set function, so STM can be used with the assignment operator plugin
  • Introduce getValue/setValue to allow using delegation (var x by newTVar() should work!)
  • Improve the general implementation of PList for TQueue

@serras serras requested a review from nomisRev May 14, 2024 12:30
Copy link
Contributor

github-actions bot commented May 14, 2024

Kover Report

File Coverage [85.71%]
arrow-libs/fx/arrow-fx-stm/src/commonMain/kotlin/arrow/fx/stm/STM.kt 81.93%
arrow-libs/fx/arrow-fx-stm/src/commonMain/kotlin/arrow/fx/stm/TQueue.kt 94.44%
Total Project Coverage 60.90%

Copy link
Member

@nomisRev nomisRev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me @serras! Very nice improvements 👏 👏

*
* <!--- KNIT example-stm-12.kt -->
*/
public operator fun <A> TVar<A>.setValue(thisRef: Nothing?, property: KProperty<*>, value: A) { write(value) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@nomisRev nomisRev merged commit 514c2c3 into main May 17, 2024
11 checks passed
@nomisRev nomisRev deleted the serras/small-stm-improvements branch May 17, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants