What is the Sendable protocol in Swift? | Swift Concurrency #11

preview_player
Показать описание
The Sendable protocol is actually a super-simple protocol that let's us tell the compiler whether or not an object is safe to send into an asynchronous context. For our purposes, this will mean whether or not we can safely send an object into an Actor!

🤙 WELCOME BACK 🤙

Рекомендации по теме
Комментарии
Автор

bro you are amazing

Edit: Also sendable acts as a guard for future safery thread checks, is someone ads a var to a sendable without being aware its being used in asyc sendable will alert them.

bhuwin
Автор

Thank you as always for your great work Nick!

XMunichX
Автор

Video! Thank you so much fore great video! A huge Salute to you times! Keep sharing your knowledge & making awesome video! genius!

piyushagrawal
Автор

8:41 - In xCode 14.1 there will only be a warning and not an error.

hashcat
Автор

Your videos are great, do you have a plan to cover Transferable

praveenperera
Автор

Awesome as always. Thank you so much!!!

andresraigoza
Автор

What is the brand of your keyboard that sound is very impress me

pmjss
Автор

Trying to think of a case that a final class would be needed where a struct or actor couldn’t fit the bill. In the unchecked sendable case shown in the video all we are really doing making an understudy, weak actor, aka an novice implementation of thread safe class? What am I missing?

lincolndickerson
Автор

hey vro ...how to make Core Data Entities conforming to Sendable??

lalitvinde
Автор

as i said before about mutating.. you must be careful.
struct MyStruct: Sendable {
var title: String

mutating func changeTitle(newTitle: String) {
title = newTitle
}

func unsafe( t: inout MyStruct) {
t.changeTitle(newTitle: "new title")
}

func test() {
var t = MyStruct(title: "hello")
unsafe(t: &t)
print(t.title)
}
}

alexvaiman