Closed ncthbrt closed 6 years ago
Hi There. I'm new to nact and the actor model in general, and so please pardon the naivety in my thinking: While I don't really have any particular problem I'm trying to solve with the actor model, and have only recently stumbled on to nact, I'm a fan of "event-based" computing with services like AWS Lambda, or Google Cloud Functions. Latency would be somewhat poor, but could you imagine an interesting use case where each remote actor is an AWS Lambda function?
@adieuadieu: That is a possibility. One of the important ideas behind actors is that communication is location transparent. This means that it shouldn't matter whether the actor is located on a dedicated server, a cloud hosted VM or even on a lamda function: all communication uses the same interface. Obviously there is a lot of work need still to get to that point, but in theory you could have a HTTP transport which could trigger a lambda function.
That being said (keeping in mind that this is the personal opinion of someone who hasn't used them in production, so feel to correct me), while I like the idea of lamda functions, I do have a few problems with them, especially when considering them as the computational strata for an actor system:
More broadly, I've been thinking quite a bit about what it would to take to offer actors as a service. In theory it should be possible and would be a more general computing framework than lamda is. That would be a very long term goal; perhaps then it'd make sense to use lamdas, but not sure.
Just a general update, I've started experimenting with the clustering interface, and I've come up with this (for reasonml), the js version should look fairly similar:
module Cluster: {
type keySelector('msg) = 'msg => int;
type routingStrategy('msg) =
| Sharded(keySelector('msg));
let createCluster: (~name: string, routingStrategy('msg)) => (actorRef('msg), clusterRef('msg));
let join: (clusterRef('msg), actorRef('msg)) => unit;
let leave: (clusterRef('msg), actorRef('msg)) => unit;
module Operators: {
let (+@): (clusterRef('msg), actorRef('msg)) => unit;
let (-@): (clusterRef('msg), actorRef('msg)) => unit;
};
};
One of the major benefits of actor systems is location transparency; being able to communicate with remote actors in the same way as local actors is an important feature of this
This feature could be as basic as having some means to allow actors to communicate when IP addresses are explicitly provided, or it could also include scheduling (deciding where actors should be put) and clustering.
Another important question is how to ensure that this architecture is flexible enough to support different kinds of transports, while selecting some sane, easy to setup defaults.