Skip to content
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

Distributed actors #1123

Closed
Obbut opened this issue Jan 3, 2023 · 2 comments · Fixed by #1318
Closed

Distributed actors #1123

Obbut opened this issue Jan 3, 2023 · 2 comments · Fixed by #1318
Milestone

Comments

@Obbut
Copy link
Contributor

Obbut commented Jan 3, 2023

Since Swift 5.7, Swift provides language-level support for distributed actors. Distributed actors can be defined using the distributed actor keywords. On distributed actors, one can define distributed methods using distributed func. For example:

distributed actor HelloActor {
    init(actorSystem: ActorSystem) {
        self.actorSystem = actorSystem
    }

    distributed func hello() {
        print("Hello!")
    }
}

Sourcery currently does not seem to provide a way to inspect if an actor or method is declared as distributed, for example with an isDistributed property on Actor or Method.

@Obbut
Copy link
Contributor Author

Obbut commented Jan 3, 2023

I just realised that it is possible to query this information by getting the modifiers of a type or method. However, I think it would still be nice if there would be a more convenient or obvious way to query this information.

@krzysztofzablocki
Copy link
Owner

@Obbut want to propose / make a pr with the more useful API? I'd be game to merge something like this

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 a pull request may close this issue.

3 participants