[Second review] SE-0392: Custom Actor Executors

Hi, I have a question.

Some assert(precondition) methods like assertisolated were introduced in this proposal.

Now, we can use them only on more than iOS 17.0(macOS 14.0, , watchOS 10.0, tvOS 17.0).

Is there possibility that we can use these methods on older versions?

The new APIs weren't implemented with back deployment in mind yet, but it seems possible that they could provide a back-deployed implementation using existing functionality in older versions of the concurrency runtime. It'd be worth filing a bug report asking to make these APIs back deployable.

3 Likes

Thanks for taking your question here! As @Joe_Groff pointed out it might still be possible to make these APIs back deployable. You can file a bug report over in the GitHub repository of Swift: Sign in to GitHub · GitHub

Also @ktoso who was the original author of the proposal and might have extra context here.

You can file a bug report over in the GitHub repository of Swift: Sign in to GitHub · GitHub

Thank you for the answer! I'll do it.

1 Like

Thanks for raising the issue, I think we can try to backdeploy these. We’ll have to check though, thanks for the issue in advacce

1 Like

Thank you! I created the Github issue.

1 Like

I'd like to play around with the current state of affairs. Is there a self-contained example anywhere that e.g., reimplements @MainActor using a custom executor as a starting point?

What do you mean with "reimplements main actor"?

The code is available in current betas because the proposal was accepted and merged. Take an Xcode and use an unownedExecutor in an actor and you're good to go.

An example that reimplements @MainActor would be a demo of a global actor that dispatches to the main thread.

But nevermind, I have something working now,