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 deep dive
- WWDC
- modern concurrency
- SWIFT
- 야곰 # 야곰아카데미커리어스타터캠프 #iOS개발자 # 부트캠프
- APNS
- 티스토리챌린지
- 오블완
- ios
Archives
- Today
- Total
Geon
Modern Concurrency Deep Dive(12) 본문
iOS developer essential skills/Modern Concurency
Modern Concurrency Deep Dive(12)
jgkim1008 2024. 11. 25. 23:34작업 취소
- Task 내부에, Task 구현시 취소를 전파하지 못함
- try? await 은 nil 을 리턴하여 취소시에 에러를 리턴하지 않고 바로 다음줄 실행
- Task.checkCancellation() 은 취소에 대한 에러를 리턴해줌
var task = Task {
print("시작")
Task {
await someFunction()
await someFunction()
await someFunction()
print(Task.isCancelled) // false
}
}
sleep(3)
task.cancel()
'iOS developer essential skills > Modern Concurency' 카테고리의 다른 글
Modern Concurrency Deep Dive(14) (0) | 2024.11.27 |
---|---|
Modern Concurrency Deep Dive(13) (1) | 2024.11.26 |
Modern Concurrency Deep Dive(11) (0) | 2024.11.24 |
Modern Concurrency Deep Dive(10) (0) | 2024.11.23 |
Modern Concurrency Deep Dive(9) (0) | 2024.11.22 |