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

How to configure distributed multi-actor system #134

Open
technomage opened this issue Jul 30, 2024 · 1 comment
Open

How to configure distributed multi-actor system #134

technomage opened this issue Jul 30, 2024 · 1 comment
Labels
A-core Area: The elfo-core crate. C-feature-request Category: A feature request.

Comments

@technomage
Copy link

technomage commented Jul 30, 2024

I see how I can have multiple actors in a group in a single executable. It is not clear if I can have the same group in multiple executables to share the workload of messages. When the topology is built it appears to separate groups into local or remote and no way to have both? Ideally I would like each actor in a group spread over many executables (pods in Kubernetes) process messages for the keys the manage.

@loyd
Copy link
Collaborator

loyd commented Aug 7, 2024

I'm sorry for not getting back to you sooner.

An actor group cannot contain actors across multiple nodes, but each node can have a group with the same name and routing between them.

// Service A (nodes 1, 2, 3)
let consumers = topology.local("consumers");

// Service B (nodes 4, 5)
let remote_consumers = topology.remote("consumers");
let producers = topology.local("producers");

producers.route_to(&remote_consumers, |e, nd| {
    msg!(match e {
        SomeEvent => ...,
    });
});

The second argument nd (node discovery) is supposed to be used to choose node among the connected ones to avoid explicit routing (SomeEvent { node_no } => Outcome::Unicast(node_no)).

However, it doesn't provide now any methods to do it because we need to decide which syntax to use for it. In the simplest form it can be

SomeEvent => Outcome::Unicast(nd.random()), // nd.nearest_by_rtt() and so on

But how should it look when sent to multiple nodes (Outcome::Multicast(nd.by_tag("something")))? It's not very flexible.

This, it's not the question of implementation, but more of API design =(

@loyd loyd added A-core Area: The elfo-core crate. C-feature-request Category: A feature request. labels Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: The elfo-core crate. C-feature-request Category: A feature request.
Projects
None yet
Development

No branches or pull requests

2 participants