Replies: 1 comment 3 replies
-
Hi @philipbel, it is true that dependencies are required to be sendable because ultimately they are stored in a If Since Swift 6 is still not officially out, and who knows how sendability is going to settle in Apple frameworks, I am going to convert this to a discussion for now. As we get closer to the final release of Swift 6 we will update the docs accordingly and make sure it is clear that dependencies must be sendable. |
Beta Was this translation helpful? Give feedback.
-
Description
Reading on TCA/Dependencies, I stumbled upon this requirement for dependencies to be
Sendable
. Am I missing something?DependencyKey
(viaTestDependencyKey
) requires thatValue
conform toSendable
.Reading the Protocol-based dependencies section of the documentation, this example is wrong (or misleading at the very least):
LiveAudioPlayer
is notSendable
and can't be easily madeSendable
, asAVAudioEngine
is a class.Checklist
main
branch of this package.Expected behavior
Documentation should clearly state the
Sendable
requirements and provide guidelines how to isolate to a global actor, if that makes sense (too new to TCA, not even sure whether isolating toMainActor
is possible).Actual behavior
Dependencies must be
Sendable
or the compiler generates a warning (presumably an error in Swift 6).Steps to reproduce
Dependencies version information
1.3.2
Destination operating system
iOS 17
Xcode version information
15.4
Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions