I had probably missed the SE-0336 review, and I just found I was not so satisfied with the restriction of “distributed actor initializer must accept exactly one ActorSystem parameter”. Of course it is uncommon to pass multiple ActorSystems to the initializer, but such restriction and the initializer’s runtime behavior just didn’t fit in any existing Swift programming rules, and thus would be unexpected for anyone who didn’t know about it.

Given the implementation detail, I would suggest to let user specify self.actorSystem = … manually, and the runtime would synthesize self.id = self.actorSystem.assignID(Self.self) immediately after it. Users will be aware of what system is actually doing, and the additional restriction on the parameters will go.


EDIT: Can this also help with “long running initializer” problem by encouraging developers to postpone self.actorSystem initialization?

1 Like