George, thanks for the feedback! Yes, actors is about messages and addresses. What I was not able to explain clearly, is that I'm using method + arguments as a message, only I want not to lost the natural way of writing programs.
I'm tackling remote actors, transparently, in my next project, WIP: https://github.com/ajlopez/SimpleRemote (see the tests) (a dnode-like experiment) Now, there are only remote objects. The client proxy object looks like a common Javascript object, internally it has the address of the remote object. I want to implement distributed web crawler, as example. The code will be the same, except that the changing part is how to get the object/agent. But the dependency injection is practically the same. One thing I see in actor model, is that you have to know the address of the agent to call. Another approach, sending a message to be processed by some node (local, remote), wo/having address, based on ideas by @asehmi at: https://github.com/ajlopez/AjFabriqNode but I wrote only the most simple sample. In the original work I did in C#, I could implement a distributed web crawler, without having actors with address, only messages. It's a fascinating topic ;-) And Node.js is a great platform to explore. On Tue, Jun 5, 2012 at 3:45 PM, George Stagas <[email protected]> wrote: > You say actors, but in the example you use shared object properties to > call methods from the other actors. > > Actors can only speak with messages, and can only know the addresses > of other actors. If you're passing a shared memory reference to invoke > methods from another actor then it's not actors. It's plain objects > with a message queue, with all the drawbacks. > > How to mentally test if something is an actor: Just ask yourself: "If > I take this actor alone, and put it in another machine, will the > actors in this machine, still be able to talk to that actor far away > without changing one line of code?" > > If the answer is yes, then you've probably implemented The Actor Model. > > 2012/6/5 Angel Java Lopez <[email protected]>: > > Hi people! > > > > (I borrowed next phrase from a recent email by Alan Hoffmeister, English > is > > not my native language ;-) > > > > I just needed to improve my Node.js file system skills, so I created > > SimpleActors. > > > > SimpleActors wraps up a Javascript object, so if you call one of its > method > > it is queued to be run as an event. In this way > > calling a method is like sending a message in actor model. > > > > If you are interested in the returning value, you can add an additional > > parameter with a callback function. > > > > https://github.com/ajlopez/SimpleActors > > > > A simple web crawler is included with the samples (with git clone, not in > > with npm package). > > > > Critics, comments, issues are welcome! > > > > Angel "Java" Lopez > > http://ajlopez.wordpress.com > > http://twitter.com/ajlopez > > > > > > -- > > Job Board: http://jobs.nodejs.org/ > > Posting guidelines: > > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > > You received this message because you are subscribed to the Google > > Groups "nodejs" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group at > > http://groups.google.com/group/nodejs?hl=en?hl=en > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
