Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jacobsapps/9b34bd67e17004a97f1a719131946122 to your computer and use it in GitHub Desktop.
Save jacobsapps/9b34bd67e17004a97f1a719131946122 to your computer and use it in GitHub Desktop.
// safe to pass between arbitrary Tasks, async functions, and Actors
struct UserData: Sendable {
var id: Int
var name: String
}
// safe because properties are immutable and we can't subclass
final class User: Sendable {
let name: String
let age: Int
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment