Avatar
Taskをどのexecutorで実行するかを指定できるようになる機能のReviewが始まってました。 Task(on: executor) { // starts and runs on the 'executor' await nonisolatedAsyncFunc() } Task.detached(on: executor) { // starts and runs on the 'executor' await nonisolatedAsyncFunc() } await withDiscardingTaskGroup { group in group.addTask(on: executor) { // starts and runs on the 'executor' await nonisolatedAsyncFunc() } } func nonisolatedAsyncFunc() async -> Int { // if the Task has a specific executor preference, // runs on that 'executor' rather than on the default global concurrent executor return 42 } https://forums.swift.org/t/se-0417-task-executor-preference/68958 (edited)
Hello Swift community, The review of SE-0417 "Task Executor Preference" begins now and runs through December 26th, 2023. Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would like to keep your feedback private, directly to me as the review manager via the forum ...
👀 2