A super minimal java actor library
Clone or download
Latest commit 33c52ff Mar 9, 2017
Permalink
Failed to load latest commit information.
.idea one file lib Mar 22, 2016
src one file lib Mar 22, 2016
.gitignore Initial commit Apr 26, 2013
LICENSE Initial version of the tested and reviewed actor library. Apr 26, 2013
README.md Update README.md Mar 9, 2017
build.gradle one file lib Mar 22, 2016
settings.gradle one file lib Mar 22, 2016

README.md

actor

A minimal java actor library.

package com.benbria.actor;

public class ActorExample {
    public static void main(String[] args) throws InterruptedException {
        Actor<String> actor = Actor.createAndStart(new Actor.Behavior<String>()
            @Override
            public boolean onReceive(Actor<String> self, String msg) {
                System.out.println("Got: " + msg);
                return !msg.equals("stop");
            }

            @Override
            public void onException(Actor<String> self, Exception e) {}
        });

        actor.send("hello");
        actor.send("world");
        Thread.sleep(1000);
        actor.send("stop");
    }
}

Output:

Got: hello
Got: world

License

MIT