If you want to learn about the actor model, then Akka is a good place to start.
ActorJs is meant to be a fairly full-fledged actor model that runs in both the browser and on the server. It was originally started as a fork of NActor, but has since grown into its own codebase. It was re-designed from the ground up with no NActor code in here. NActor is a great little project, though, and I encourage you to check it out.
The original fork of NActor from which this code was pulled, can be found at https://github.com/JediMindtrick/rNr.
There are a couple of js/nodejs based actor libraries out there, few if any, of which implement the following features:
- Basic Supervision
- Hot-swapping of actor implementations
- Location transparency of remote actors
This is too bad, as these are some of the features that make the actor model so powerful. So basically, I've had this itch for awhile and a few weeks ago decided to go ahead and scratch it :)
This is a learning/exploratory project for me and at present should not be considered fit for production, although feedback is certainly welcome.
In terms of design/implementation here are some general tools and guidelines I will attempt to follow:
- Written in ES6, transpiled with babel
- Unit tested and linted with chai and eslint
- Inspired by Erlang and Akka, but not aspiring to be a port of either
- Deterministic processing of messages
- Functional programming techniques and constructs will be used as often as appropriate*
*Ironically, actors themselves are pretty darn stateful.
npm install -g babel
npm install -g jscs
npm install -g eslint
npm install -g babel-eslint
npm install -g nodemon
npm run dev
Using babel & eslint for linting and transpiling.
Using jscs to help with styling.
Here's a good tutorial on using eslint
MIT