One of the things I've discovered myself wanting is the ability for an actor to forward a message to another actor. Consider this:
X sends message M to actor A
Actor A forwards M to actor B
Actor B responds directly to future held by X
To support this functionality, I propose a new forward method on Actor:
**
** Forward a message to the specified actor. The result of the forwarded
** message is used as the response of the current request.
**
Obj forward(Actor a, Obj? msg)
For example here is how it would work:
future := a.send(msg)
// in a's receive
Obj receive(Obj msg, Context cx) { return forward(b, msg) }
// in b's receive
Obj receive(Obj msg, Context cx) { return result }
future.get // original future now contains result of b
brian Thu 18 Jun 2009
One of the things I've discovered myself wanting is the ability for an actor to forward a message to another actor. Consider this:
To support this functionality, I propose a new
forward
method on Actor:For example here is how it would work:
Comments welcome