Skip to content

Include an queue-backed actor example #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

mattmassicotte
Copy link
Collaborator

This adds both disucssion and an example of a queue-backed actor.

However, I've just discovered that the asUnownedSerialExecutor API isn't available in Xcode 16 beta 1. So, I'm just going to leave this in draft form until a new beta is released.

@FranzBusch
Copy link
Member

However, I've just discovered that the asUnownedSerialExecutor API isn't available in Xcode 16 beta 1. So, I'm just going to leave this in draft form until a new beta is released.

DispatchSerialQueue adopted SerialTaskExecutor on macOS 14.0 so this should already be available in Xcode 15. How did you test this? Importantly, there is currently a compiler bug with availability so you have to check that the minimum platform version for your target is macOS 14.0 otherwise you won't be able to access the conformance to SerialTaskExecutor of the queue.

@mattmassicotte
Copy link
Collaborator Author

mattmassicotte commented Jun 21, 2024

@FranzBusch I think that bug is exactly what I'm experiencing!

If I increase the package platform minimum to macOS 14, this code works without any availability guards required. But, with just the @available and #available I'm currently using, it does not.

@mattmassicotte mattmassicotte linked an issue Jun 24, 2024 that may be closed by this pull request
@ktoso
Copy link
Contributor

ktoso commented Jun 28, 2024

Sounds weird? @available should work fine -- please file a bug if you can reproduce it

@FranzBusch
Copy link
Member

Tracked internally in rdar://116684282

@DougGregor
Copy link
Member

I came looking for exactly this PR, thank you! I'm going to look into the compiler bug that's causing problems with @available here, but I'd urge you not to block merging this pull request on our resolution of that bug.

@mattmassicotte mattmassicotte marked this pull request as ready for review July 15, 2024 15:08
@mattmassicotte
Copy link
Collaborator Author

@DougGregor thank you so much for checking in on this. Sorry it took me so long to follow up. I've commented out the offending code to keep the examples building.

@mattmassicotte mattmassicotte merged commit a0df68a into main Jul 15, 2024
@mattmassicotte mattmassicotte deleted the mattmassicotte/59-actor-queue branch July 15, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example of queue-backed actor
4 participants