/Aurora

Even simpler concurrency in Javascript

Primary LanguageJavaScript

Aurora, even simpler concurrency for javascript

The aim is to create a simple but effective way to use concurrency in Javascript. The API for the worker interface is nice and compact, but this means that you will have to implement all code yourself. This framework will gie you a way to skip writing boilerplate code.

Aurora is inspired by Scala and Akka Actors.

Usage example

In this example we will create a new Actor, set the message handling function and send it a message. It will then return this message.

var actor = new Actor();
actor.init();
actor.receive(function(msg){
		return msg;
	});
actor.send('Hello world');

In this second example we will sort an array in a separate thread.

var actor = new Actor();
actor.init();
actor.receive(function(array)
	{
		return array.sort();
	}
);
actor.send([2,6,4,10,3,7]);