Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Move ManagedAsynchronousAccess to SpeziFoundation #47

Open
1 task done
Supereg opened this issue Aug 16, 2024 · 0 comments · May be fixed by #49
Open
1 task done

Move ManagedAsynchronousAccess to SpeziFoundation #47

Supereg opened this issue Aug 16, 2024 · 0 comments · May be fixed by #49
Labels
enhancement New feature or request

Comments

@Supereg
Copy link
Member

Supereg commented Aug 16, 2024

Problem

We introduced the ManagedAsynchronousAccess type to easily create a continuation that is protected by an AsyncSemaphore. This type is currently internal and cannot be reused across the framework ecosystem.

Solution

Move this type to the SpeziFoundation package. ideally, we wait for until Spezi enforces the Swift 6 toolchain as it introduces actor inheritance for async method calls. This way we can have the perform methods inherit actor isolation, executing the action on the same Task and not requiring a global actor annotation.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines
@Supereg Supereg added the enhancement New feature or request label Aug 16, 2024
Supereg added a commit to StanfordSpezi/SpeziFoundation that referenced this issue Oct 17, 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](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).
@Supereg Supereg linked a pull request Nov 4, 2024 that will close this issue
1 task
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant