|
1 | 1 | # Task Executor Preference
|
2 | 2 |
|
3 |
| -* Proposal: SE-NNNN |
| 3 | +* Proposal: [SE-0417](0417-task-executor-preference.md) |
4 | 4 | * Author: [Konrad 'ktoso' Malawski](https://github.com/ktoso), [John McCall](https://github.com/rjmccall), [Franz Busch](https://github.com/FranzBusch)
|
5 |
| -* Review Manager: TBD |
6 |
| -* Status: Partially implemented [PR #68793](https://github.com/apple/swift/pull/68793) |
7 |
| -* Implementation: TBD |
| 5 | +* Review Manager: [Doug Gregor](https://github.com/DougGregor) |
| 6 | +* Status: **Active Review (December 12...26, 2023)** |
| 7 | +* Implementation: [PR #68793](https://github.com/apple/swift/pull/68793) |
8 | 8 | * Review: TBD
|
9 | 9 | * Discussion threads:
|
10 | 10 | * Pitch: [Pitch: Task Executor Preference](https://forums.swift.org/t/pitch-task-executor-preference/68191)
|
11 |
| - |
| 11 | + |
12 | 12 | ## Introduction
|
13 | 13 |
|
14 | 14 | Swift Concurrency uses tasks and actors to model concurrency and primarily relies on actor isolation to determine where a specific piece of code shall execute.
|
@@ -178,17 +178,17 @@ await withTaskExecutor(someExecutor) {
|
178 | 178 | Once set, the effect of an executor preference is such that a nonisolated func instead of immediately hopping to the global pool, it may hop to the preferred executor, e.g.:
|
179 | 179 |
|
180 | 180 | ```swift
|
181 |
| -nonisolated func tryMe() async { |
| 181 | +nonisolated func doSomething() async { |
182 | 182 | // ...
|
183 | 183 | }
|
184 | 184 |
|
185 | 185 | let preferredExecutor: SomeConcreteTaskExecutor = ...
|
186 | 186 | Task(on: preferredExecutor) {
|
187 | 187 | // executes on 'preferredExecutor'
|
188 |
| - await tryMe() // tryMe body would execute on 'preferredExecutor' |
| 188 | + await doSomething() // doSomething body would execute on 'preferredExecutor' |
189 | 189 | }
|
190 | 190 |
|
191 |
| - await tryMe() // tryMe body would execute on 'default global concurrent executor' |
| 191 | + await doSomething() // doSomething body would execute on 'default global concurrent executor' |
192 | 192 | ```
|
193 | 193 |
|
194 | 194 | ### The `TaskExecutor` protocol
|
|
0 commit comments