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

Add RWLock and ManagedAsynchronousAccess #17

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Supereg
Copy link
Member

@Supereg Supereg commented Sep 11, 2024

Add RWLock and ManagedAsynchronousAccess

♻️ Current situation & Problem

This PR adds the RWLock, RecursiveRWLock and ManagedAsynchronousAccess infrastructure that was previously introduced in SpeziBluetooth (see StanfordSpezi/SpeziBluetooth#45 and StanfordSpezi/SpeziBluetooth#47).
This changes require the Swift 6 toolchain. Therefore, we increase the required swift tools version to 6.0.

This PR introduces the final changes for the SpeziFoundation 2.0 release (assuming #16 is merged beforehand).

⚙️ Release Notes

  • Added RWLock and RecursiveRWLock
  • Added ManagedAsynchronousAccess
  • Only require sending closure with withTimeout instead of a @Sendable one.

📚 Documentation

Updated the documentation catalog, adding a new "Concurrency" topics section.

✅ Testing

Added unit test for the new components.

📝 Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@Supereg
Copy link
Member Author

Supereg commented Sep 11, 2024

@PSchmiedmayer The CI is currently failing as we are still using Xcode 15 as the stable release. I would avoid setting all the GitHub jobs to use the latest version of Xcode. Otherwise, we would need to change everything back.
I assume the Xcode would be release next Monday alongside the OS releases. I would wait till we upgraded the runner to use Xcode 16 by default to merge the PR if that makes sense 👍

Copy link

codecov bot commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 97.91667% with 4 lines in your changes missing coverage. Please review.

Project coverage is 91.27%. Comparing base (17bd0e0) to head (69c7af7).

Files with missing lines Patch % Lines
Sources/SpeziFoundation/Concurrency/RWLock.swift 93.23% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #17      +/-   ##
==========================================
+ Coverage   83.06%   91.27%   +8.21%     
==========================================
  Files           9       12       +3     
  Lines         301      492     +191     
==========================================
+ Hits          250      449     +199     
+ Misses         51       43       -8     
Files with missing lines Coverage Δ
...s/SpeziFoundation/Concurrency/AsyncSemaphore.swift 80.30% <ø> (ø)
...dation/Concurrency/ManagedAsynchronousAccess.swift 100.00% <100.00%> (ø)
.../SpeziFoundation/Concurrency/RecursiveRWLock.swift 100.00% <100.00%> (ø)
Sources/SpeziFoundation/Misc/TimeoutError.swift 60.00% <100.00%> (ø)
Sources/SpeziFoundation/Concurrency/RWLock.swift 93.23% <93.23%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 17bd0e0...69c7af7. Read the comment docs.

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.

1 participant