It’s time to write about the project:
I’m implementing the first steps towards an actor model, message passing, taking ideas from Akka. I had worked something in Node.js, and C#, having actors sending messages to each other, but this time I want to follow the path of Akka, step by step, for example, have names of actors, in a tree, distributed system of actors, and monitoring agents.
The status of the project today:
The current actor implementation:
First, an Actor is an abstract class, to be implemented in each use case. The rest of the system would not talk to an actor directly, but through a ActorRef. For example, to send a message, there is a method Tell in ActorRef. Internally, no process sends messages to the actor directly, but each actor has a Mailbox. And the mailbox is used by ActorRef to send a message to the final Actor. The Actor object is a passive object: it not manage the Mailbox directly, but there are threads that will take pending tasks, get message from Actor mailbox, and send it to the Actor. The system internally ensures that the actor receives and processes messages one by one. The actor does not have to worry about competition from multiple threads. Notably, the Actor has no direct reference to the Mailbox. More details in upcoming posts.