Ok, it's time for another one of these "Swift concurrency step-by-step" posts.
It explores working with types that are not Sendable. All based around reading a model from some data store.
https://www.massicotte.org/step-by-step-reading-from-storage
It explores working with types that are not Sendable. All based around reading a model from some data store.
https://www.massicotte.org/step-by-step-reading-from-storage
Comments
One question - you say "non-isolated + async means runs in the background" (and you reiterate the same later)...
Or is it really *guaranteed* to run only on a non-main actor?
Oh shit sorry that's not one question π
[apologies for spam replies, I initially replied to your bridged post from mastodon]
Your questions are really good. The migration guide goes into a bunch of details here (https://www.swift.org/migration/documentation/swift-6-concurrency-migration-guide/dataracesafety). But quickly:
This is true for all versions of swift >= 5.7. Language mode does not affect language semantics.
Hmmm that is a really interesting question. I do not know! Have you tried this and run into trouble?
This a common issue with custom lock implementations too.
Definitely a read for later!