Task's Forward Progress with sync code

Hi Miguel, nice to see you here!

This is what we aim to allow with Task Executors which are now partially implemented on main (wiggling around with the APIs still a little bit), and under review over here: SE-0417: Task Executor Preference

They'll allow you to start a Task on a specific TaskExecutor, and the executor is then preferred instead of the global shared pool. A prime use case for those is isolating some blocking code you cannot rewrite onto a bunch of dedicated threads/queues that you encapsulate with this TaskExecutor and at least then all the bad blocking code is isolated to this pool of threads, rather than hurting the width-limited default one.

Hope this helps!

If you can't really wait for these, you could somewhat achieve a similar result by using a custom actor executor swift-evolution/proposals/0392-custom-actor-executors.md at main · apple/swift-evolution · GitHub so make a SerialExecutor and dedicate it some queue or thread, and make all your blocking calls from an actor which use this executor. You could of course have many actors use either the same executor or each have its own etc. Not as great as the task executors for this purpose but it'd also help get the blocking away from the shared pool but still be able to use async/await.