Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- modern concurrency
- 오블완
- 야곰 # 야곰아카데미커리어스타터캠프 #iOS개발자 # 부트캠프
- APNS
- SWIFT
- WWDC
- ios
- modern concurrency deep dive
- 티스토리챌린지
Archives
- Today
- Total
Geon
Modern Concurrency Deep Dive(15) 본문
iOS developer essential skills/Modern Concurency
Modern Concurrency Deep Dive(15)
jgkim1008 2024. 11. 28. 23:31Task
- Task를 호출하는곳은 컨텍스트를 상속받기에 메인쓰레드에서 동작
- fetchImage가 비동기라서 메인쓰레드에서 Call하기에 문제가 되나 싶지만 문제가 안됨
- Modern Concurrency의 경우 Non-Blocking 이기에 호출후 기다리지 않고 쓰레드를 시스템에 넘긴후 다른 일처리 함
- Task.detached를 사용하는것도 효율적이라고 생각됨
func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell) {
Task {
let image = await fetchImage()
updateCell(image)
}
}
'iOS developer essential skills > Modern Concurency' 카테고리의 다른 글
Modern Concurrency Deep Dive(17) (0) | 2024.12.10 |
---|---|
Modern Concurrency Deep Dive(16) (0) | 2024.12.02 |
Modern Concurrency Deep Dive(14) (0) | 2024.11.27 |
Modern Concurrency Deep Dive(13) (1) | 2024.11.26 |
Modern Concurrency Deep Dive(12) (0) | 2024.11.25 |