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

Support building LiveKit with Complete concurrency checking on #430

Open
dfed opened this issue Jul 12, 2024 · 0 comments
Open

Support building LiveKit with Complete concurrency checking on #430

dfed opened this issue Jul 12, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@dfed
Copy link

dfed commented Jul 12, 2024

Is your feature request related to a problem? Please describe.
I have Complete concurrency checking turned on in my project. When integrating LiveKit, I get the following compile-time warning when referring to AudioManager.shared:

Class property 'shared' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in Swift 6

I can work around this by declaring the following in my code:

extension AudioManager: @unchecked Sendable {
    // AudioManager is indeed Sendable since it utilizing locks under the hood.
}

But it'd be ideal to not need to make this declaration myself.

Describe the solution you'd like
Ideally LiveKit target would compile without concurrency warnings with .enableExperimentalFeature("StrictConcurrency"), turned on in Swift 5.10+.

Describe alternatives you've considered
Harder option: Get LiveKit compiling in Swift 6 language mode on Xcode 16
Easier option: Embrace the @preconcurrency import and just mark types that are made public and available statically as Sendable or @unchecked Sendable assuming the underlying type is indeed thread-safe.

Additional context
Happy to provide some support here – I've gotten a few projects working in Swift 6 language mode already (example) and am familiar with Swift Concurrency's trap doors (and some of the differences between the Swift 5 and Swift 6 concurrency functionality).

This issue is not blocking to adoptees of LiveKit, which is why I've classified this issue as a feature request.

@dfed dfed added the enhancement New feature or request label Jul 12, 2024
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
None yet
Development

No branches or pull requests

2 participants