Skip to content

axblount/simpleactors

Repository files navigation

Simple Actors

license

A simple actor framework for java.

import org.simpleactors;

public class Main {
    public static class MyActor extends Actor {
        @Override public void handle(Object msg) {
            if (msg instanceof String)
                System.out.println("Someone said: " + msg);
            else
                System.out.println("I don't get it...");
        }
    }

    public static void main(String[] args) {
        ActorSystem sys = new ActorSystem("test");

        ActorRef ref = sys.spawn(MyActor.class);
        ref.send("Hi!");
        ref.send(17);
    }
}

Motivation

I was curious about the implementation of an actor framework. Much of the API has been inspired by Akka, but any similarity to its internals in coincidental (I haven't peeked... yet).

I can't hope to create something as robust or full featured as Akka. Instead I'll aim for something small and easy to understand.

About

A simple actor framework for Java.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages