tartjs
Stability: 1 - Experimental
JavaScript implementation of Tiny Actor Run-Time.
Contributors
Usage
var Tart = ; var config = ; // create an actor that has no state and can't change behaviorvar actor = config; // create a value actor that has state, but can't change behaviorvar value = config; // create a serial actor that has state and can change behaviorvar serial = config; config;config;config;
Tests
npm test
Benchmarks
Erlang Challenge
Erlang Challenge consists of creating a ring of M actors, sending N simple messages around the ring and increasing M until running out of resources.
The benchmark implements a modified version of the challenge by creating 100,000 actors and running 10 simple messages around the ring.
npm run erlangChallenge
constructed 100000 actor ring
..........
done
all times in NANOSECONDS
construction time:
2900829022
loop times:
627685921
631848011
666029990
731236694
775333540
615891053
612743213
684856367
721228999
769791008
611477526
loop average:
677102029.2727273
Overview
The goal of tartjs
is to provide the smallest possible actor library in JavaScript that has the full power of a "pure" actor model of computation.
Configurations
TODO
Actors
Actors consist only of behaviors and maintain no internal state. To create a new actor:
var Tart = ;var config = ;var actor = config;
Value Actors
Value actors consist of behaviors and state, but cannot change the behavior. To create a new value actor:
var Tart = ;var config = ;var value = config;
Serial Actors
Serial actors have state and can change their behaviors by using event.become()
function. To create a new serial actor:
var Tart = ;var config = ;var serial = config;
Documentation
TODO