Actor.enqueue(partialTask:) is a protocol requirement, while
Actor.run(operation:) is protocol extension.
Shouldn't it be the other way around, or both be extensions? AFAICT,
PartialAsyncTask is completely opaque, so overriding
enqueue wouldn't provide any benefit.
OTOH, I can see an actor delegating
run onto another (dynamic) actor.
enqueue(partialTask:)requirement is special in that it can only be provided in the primary actor class declaration (not an extension), and cannot be
Could someone explain why having it be non-
final would is required? I'm not sure why this would be different from having no-one overriding it. Maybe this is related to the previous question?
Should global actor be a protocol, instead of type annotation? It doesn't seem to require complex requirement, like property wrapper does, and we already need to define another protocol (
Or maybe we can even have it as a single global declaration:
// top-level @globalActor let uiActor = SomeActorInstance.
We may be able to have
class, but I think this is about a good balance.