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

Introduce RWLock, ManagedAsynchronousAccess and DataDescriptor #17

Merged
merged 8 commits into from
Oct 17, 2024

Conversation

Supereg
Copy link
Member

@Supereg Supereg commented Sep 11, 2024

Introduce RWLock, ManagedAsynchronousAccess and DataDescriptor

♻️ 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.
  • Add new DataDescriptor type.

📚 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 92.40122% with 25 lines in your changes missing coverage. Please review.

Project coverage is 90.44%. Comparing base (2506285) to head (dac11af).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
Sources/SpeziFoundation/Misc/DataDescriptor.swift 78.13% 14 Missing ⚠️
...s/SpeziFoundation/Concurrency/AsyncSemaphore.swift 81.09% 7 Missing ⚠️
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%   90.44%   +7.38%     
==========================================
  Files           9       13       +4     
  Lines         301      596     +295     
==========================================
+ Hits          250      539     +289     
- Misses         51       57       +6     
Flag Coverage Δ
90.44% <92.41%> (+7.38%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...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%> (ø)
...s/SpeziFoundation/Concurrency/AsyncSemaphore.swift 80.86% <81.09%> (ø)
Sources/SpeziFoundation/Misc/DataDescriptor.swift 78.13% <78.13%> (ø)

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 2506285...dac11af. Read the comment docs.

@Supereg Supereg force-pushed the feature/concurrency-infrastructure branch from 69c7af7 to 3d1ac1d Compare September 26, 2024 08:58
@Supereg Supereg changed the title Add RWLock and ManagedAsynchronousAccess Introduce RWLock, ManagedAsynchronousAccess and DataDescriptor Sep 30, 2024
Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

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

Amazing; job! Looks great @Supereg!

@PSchmiedmayer PSchmiedmayer added the enhancement New feature or request label Oct 17, 2024
@Supereg Supereg merged commit 5b4ad1b into main Oct 17, 2024
10 checks passed
@Supereg Supereg deleted the feature/concurrency-infrastructure branch October 17, 2024 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants