I'm playing around with custom actor executors a bit ... as seen in What's new in Swift at WWDC 2023...
The following code errors out:
@available(iOS 17.0, *)
actor TestActor {
private let queue: DispatchSerialQueue
nonisolated var unownedExecutor: UnownedSerialExecutor { queue.asUnownedSerialExecutor() }
...
Value of type 'DispatchSerialQueue' has no member 'asUnownedSerialExecutor'
There is the _DispatchSerialExecutorQueue
that actually does provide the asUnownedSerialExecutor()
function ... This conflicts a bit with what Doug said during the talk...
"The synchronization of actors via dispatch queues is made possible because dispatch queue conforms to the new SerialExecutor protocol."