Тёмный

3 MISTAKES to avoid when using Async / Await in Swift 😌 

Vincent Pradeilles
Подписаться 16 тыс.
Просмотров 10 тыс.
50% 1

#iOS #swift #softwaredeveloper #iosdeveloper
Thank you for watching this video 🙌
➜ Website: www.swiftwithvincent.com
➜ Twitter: / v_pradeilles
➜ GitHub: github.com/vincent-pradeilles/
➜ LinkedIn: / vincentpradeilles

Наука

Опубликовано:

 

10 апр 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 14   
@v_pradeilles
@v_pradeilles Год назад
⚠ There's a a slight mistake at 04:10: while it's true that the `Task.detached` won't be canceled, it would have also been the same for a regular `Task`. ⚠
@mazedar_tv
@mazedar_tv 6 месяцев назад
so is Task.detached beneficial only if developer wants that task to execute out of main actor?
@FloWritesCode
@FloWritesCode Год назад
Tip #2 was really good, Vincent! I never thought about where to place the guard let self. Thanks for sharing!
@v_pradeilles
@v_pradeilles Год назад
You're welcome! It's such a tricky pitfall 😩
@mazedar_tv
@mazedar_tv 2 месяца назад
main culprint is await notifiaction (async in async), so we needed this solution.
@edwardhasted3849
@edwardhasted3849 Год назад
This is one of the most eloquent and succinct coding explanations I have found to date. Très cordialement
@alkincakiralar9932
@alkincakiralar9932 Год назад
Yesterday, i learned retain cycle from your previous videos. Today I try the Tip #2 in new sample project and I realized that the ViewModel not delocating from memory if we use the listenNotifications method as the first example. I check the ViewModel class allocation in memorygraph with everysteps to learn what's going on in the memory. Thank's for this valuable post for us !
@yonaharel1122
@yonaharel1122 Год назад
Thanks for the video! I have a question about point 2 of the video. Does creating the async stream has different effect on memory when created outside of the Task closure or inside?
@madman334
@madman334 2 месяца назад
What if I need to reference self. before loop? like: for await value in self.manager.$items.values {...}
@Foxdie993
@Foxdie993 Год назад
4:10 Are you sure that a Task (A simple Task, without detached) inside a Task will cancel in a cascade way?
@v_pradeilles
@v_pradeilles Год назад
You’re right, it wasn’t the best example, I’ve pinned a comment with a warning
@victorriurean
@victorriurean Год назад
nice
@LucasAbijmil
@LucasAbijmil Год назад
Tip #1 is interesting, however in case the refresh token is expired, it would cause a double request to get a new one. How can we avoid this with?
@v_pradeilles
@v_pradeilles Год назад
That's an interesting point! I guess it's a matter of whether you want to optimize for the normal case or for the edge case. If there's no real bad consequence to make two calls for nothing when the token has expired, I'd say it's better to stick with this simpler solution.
Далее
Илья Чикмарев - async/await в Swift
29:19
How use async and await
17:38
Просмотров 1,3 тыс.
3 MISTAKES to avoid when using closures in Swift 😌
5:02
Actor Reentrancy in Swift explained
20:18
Просмотров 997
Tips For Using Async/Await in JavaScript
16:26
Просмотров 394 тыс.
A Simpler Way to See Results
19:17
Просмотров 98 тыс.
ДЕШЕВЫЙ НОУТБУК C OZON ЗА 17000р
13:00
FullHD в 8К БЕЗ ПОТЕРЬ? | РАЗБОР
20:42
Lid hologram 3d
0:32
Просмотров 8 млн