# \[Pitch\] Task Executor Preference

**URL:** <https://forums.swift.org/t/pitch-task-executor-preference/68191>\
**Category:** Pitches\
**Tags:** concurrency, pitch\
**Created:** [November 1, 2023, 1:34pm UTC](https://forums.swift.org/t/pitch-task-executor-preference/68191 "2023-11-01T13:34:18Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![stephencelis](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/stephencelis/32/2675_2.png) [@stephencelis](https://forums.swift.org/u/stephencelis)\
**Post date:** [November 3, 2023, 4:07pm UTC](https://forums.swift.org/t/pitch-task-executor-preference/68191/18 "2023-11-03T16:07:44Z")

</div>

This looks promising!

Does task executor preference address some of the issues raised in this thread?

> [@Reliably testing code that adopts Swift Concurrency?](https://forums.swift.org/t/reliably-testing-code-that-adopts-swift-concurrency/57304):
>
> I’m having a hard time figuring out how to test application code as it adopts async-await and begins to be scheduled concurrently. I’ll try to show a simple example. Here’s a basic SwiftUI application that tracks how many times a user has taken a screen shot. It has a view model with an endpoint that spins off some async work, and then the view calls this endpoint when it first appears: class ViewModel: ObservableObject { @Published var count = 0 @MainActor func task() async { let …

More specifically, do these tools provide a more structured way of testing async code in a serialized way without having to resort to overriding the `swift_task_enqueueGlobal_hook`?

---

_[View the full topic](https://forums.swift.org/t/pitch-task-executor-preference/68191)._
