Some things stand out in the approach so far.
The actors in the test are stateless. They do computation, but do not
maintain internal state that affects follow-on communication.
Addressing the above will reveal that "require" approach is not sufficient.
When you "require" a module, the module itself is a singleton, meaning that
if you "require" it again, you will get the same exact one. Illustrative
example:
assume foo.js contains:
var k = 0;
module.exports = {foo: k};
then in console execute:
var f = require('./foo.js');
console.log(f.foo); // prints "0"
f.foo = 7;
console.log(f.foo); // prints "7"
var g = require('./foo.js');
console.log(g.foo); // prints "7" ?!
Lastly, the identity and the "hard" part of communicating between actors
via actor references is left out so far. The actor communicates to only one
hard coded "next" actor sort-of by convention.
Some fundamental things to consider about actors:
Actors have internal state.
When an actor handles a message, it can *send* a finite number of messages
to other actors.
When an actor handles a message, it can *create* a finite number of new
actors.
When an actor handles a message, it can change it's behavior for how it
will handle any follow-on messages (*become*).
I am not claiming that you cannot build useful systems without the above,
but the above are a requirement for a system to be an actor system and to
gain the benefits of it. To get the object capability benefits two other
considerations should be taken into account:
Actor addresses are unique and unforgeable.
Actor proxies are transparent. (this basically means that if I put a
man-in-the-middle actor that all it does is forward messages to some other
actors and responses back to wherever, nobody is able to tell that I'm
doing that)
I hope this is helpful.
Cheers
On Friday, September 27, 2013 3:42:11 PM UTC-5, Norman Paniagua wrote:
>
> Here is on what I working... https://github.com/norman784/node-actor-test
> feel
> free to criticise it...
>
--
--
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
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.